.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Solution to controlling the Redirect URL after saving content in a Data Form View Control

Posted By:      Posted Date: October 20, 2010    Points: 0   Category :SharePoint


I have customized a Page Layout to include a custom Data Form View Web Part that will allow users to enter comments on a news story page in a publishing site.


I was having a difficult time because when I clicked the button to save the data to the list, everything saved correctly, but the control was redirecting me to the AllItems.aspx page of the list.  This wasn't the desired behavior since the end user would prefer to see that their comment was posted on the news story page and wouldn't know what the AllItems.aspx page was for.


The save button that was created in the XSL seciton of the web part was:


<SharePoint: SaveButton runat="server" ControlMode="New" id="savebutton1" />


Microsoft has documented a RedirectUrl property on this button that I figured could change what page was loaded after the user saved the form data.  However, try as I might I could not get it to work.


Some more searching lead me to this article:


View Complete Post

More Related Resource Links

Accessing data in a dymaic form control.

I have a page that will generate upto 10 copies of some web controlls, depending on how many the user wants, but I am not sure on how to access the data the user enters into it. The code  I have is: protected void ddlAmountToAdd_SelectedIndexChanged(object sender, EventArgs e) { //Create a for loop to generate and add all the form fields then add them to the pannel for (byte i = 2; i <= Convert.ToByte(ddlAmountToAdd.SelectedValue); i++) { Label lblGameName = DynamicControlCreator.Label("lblGameName" + i, "Game Name: "); TextBox tbGameName = DynamicControlCreator.TextBox("tbGameName" + i); Label lblReleaseDate = DynamicControlCreator.Label("lblReleaseDate" + i, " Release Date (MM/DD/YYYY): "); TextBox tbReleaseDate = DynamicControlCreator.TextBox("tbReleaseDate" + i); Label lblRegion = DynamicControlCreator.Label("lblRegion" + i, " Region: "); DropDownList ddlRegion = DynamicControlCreator.DropDownList("ddlRegion" + i, Regions); Label lblRegionOther = DynamicControlCreator.Label("lblOtherRegion" + i, " Other: "); TextBox tbRegionOther = DynamicControlCreator.TextBox("tbOtherRegion" + i); Labe

Unable to store combo box value to data grid view control

Hello,         I am using fw 3.5 SP1 with VS2008. I have bind my object collection with data grid view. I can see different values in combo box inside data grid view. But when I select any one value from combo box the selected value is changed to first value of combo box as soos as user leave the cell of the gird. Can anyone tell me where should I look for this problem so that my selected value remains same as user did select it.   Nilkanth Desai  

accessing form view binded control from child control

I am using a form view control which has two binded textbox. Now at this level it works fine and the textboxes show the values from database. But when i insert a panel inside the form view and move these two textboxes inside the panel, they dont show any values. What could be the reason for this? Thanks!

do not use datagrid or form view , how can i submit data from webform to..

please help me , if i do not want to use datagrid , formview, or gridview , because it s not work with some of my script,  please hel me to submit data from 50 textbox to data base (sql2008) i really need it . thank you sorry for my enghlish

Is there any way to populate an InfoPath form field with the data from the site content type column?


I have a Form library with a form template.

The templat has a field "Office name" which should not be a fixed list of values, but a dynamical list, feeded from a different type of form. I'm a novice with InfoPath - Sharepoint and I want to find out, how can I can give users a possibility to create and maintain a list of offices and also have this list as a selection list inside main library form - ALL inside one library, if possible.

I assumed that if I publish main form (Itinerary) as a library template form and lookup form (OfficeInfo) as a SiteContent, I should be able somehow to connect to siteContent column and it's information. But I cannot see how - Site Content Gallery is not appering as a Connection item.

Can I use SiteConenct for this purpose or there are other ways to create end-user lookup lists?

Thank you!


Need help on Select button column in Data Grid to populate fields in Form View


 When I have a select a row in a Data Grid that when I click on it I want it to show the info for the person I selected in a form view on the same page as the Data Grid. Here are the columns for the Data Grid that I have set up, the column is highlighted:

<asp:DataGrid ID="MHGrid" AutoGenerateColumns="False"  
        DataSourceID="MHFoundation" DataKeyField="POPULATION_LIST_ID" 
        AllowPaging="True" AllowSorting="True" BorderStyle="Solid" 
        BorderColor="#999999" BorderWidth="3px" CellPadding="4" PageSize="4" 
        CellSpacing="2" runat="server" BackColor="Gray" Font-Bold="False" 
        Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
        <SelectedItemStyle BackColor="#FF9900" Font-Bold="False" Font-Italic="False" 
            Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
            <asp:ButtonColumn CommandName="Select"  Text="Select"></asp:ButtonColumn>
            <asp:BoundColumn D

How to create custom control in .net which can retrive data from sharepoint list and redirect to sit


Hi help me!

I am strugling this problem!

My requirement is I need to create a custom control which need to retrive data from sharepoint list, The list contain some sites information like Title, url, Scope my requirement is i need to display sites Title in my custom control and when i click on title (site name) in custom control it need to be redirect to that site and whenever list data updated automaticaly custom control data also need to be apdated automatically .

Accessing the selected value of a dropdownlist control in a Form View


I need to verify the selection in a dropdown list control is not a certain value.  It is in the edit mode of a formview.

just to verify that I could access it I tried to put the value in a label,  however it is always empty:


this is what I used

  'Dim droplist5 As DropDownList = DirectCast(FormView1.Row.FindControl("DropDownList5"), DropDownList)


            LabelHeaderwarning.Text = droplist5.SelectedValue.ToString


I also tried the validation controls but they don't seem to work with a drop down control.


Any suggestions on this would be extremely helpful



error in sharepoint 2010 designer while saving:"Content in the embedded form may be changed by the t

I am doing development  in sharepoint 2010 and facing this very weird problem.
If I create a site page with the sharepoint look and feel for that site and try to save the site page,i am getting this error:**"Content in the embedded form may be changed by the the server to remove unsafe content.Do you want to reload your page to see the results of the save? "** and when i say reload,the server removes some parts of my page, e.g onclick event of html,asp buttons.

This error just comes for any sharepoint site page,e.g i took a copy of 'How To Read Library' page just edited the text part of taht page,and when i try to save this error again comes up.

However,if i create a simple aspx page with only htmltags like head body,then thr is no problem ,everything works great. But sharepoint look and feel pages are giving troubles while saving.

has anybody seen this earlier,what could be the reason for this?


Datagrid view control producing duplicate data results when data is cached


I have a datagridview control that I'm using to display cache data to the end used on a web form. The issue that I'm having is that every time I re-run the application, and the cache data is re-generated... it loads duplicate data that's being displayed to the end user. I can't seem to figure out how to keep this from happening.

What I would like to have happen is that only unique data rows be returned and cached for the end user. Unless there are new data rows on the database that needs to be included in the cache data results...the previous data results should not be duplicated. I've tried to change a few properties on the datagridview control, but nothing seem to keep this from happening. I have included a copy of my code below. Any help would be greatly appreciated.


' Code that is used to cache data that's returned from database

Protected Sub PopulateNewhardwareSetInfo()

   Dim conn As SqlConnection = New SqlConnection(m_connectionString)

   Dim cmd As SqlCommand = New SqlCommand("Select * from HardwareSet", conn)  

   Dim sqlDA As SqlDataAdapter = New SqlDataAdapter(cmd)      

   sqlDA.FillSchema(m_ItrackerData, SchemaType.Source, "HardwareSet")

windows form control library unable to view in client pc


Hi all,

i have another problem regarding the windows form control library.

recently i test the program in my own pc, the windows form control is running.

but when i try access my project in local network client pc, the windows form control doesn't show.

it just an empty.

may i know what is the problem?

My project is embedded the windows form control in aspx.

i got the cache in client pc, the windows form dll have inside the cache and also the client pc have .net framework install.

in my own pc, i also disable my firewall.

the result still same, the control cannot show on client pc.

Anyone can help me?


How to create a custom content type with own custom view ,add, edit and delete form in sharepoint fo


How to create a custom content type with own custom view ,add, edit and delete form in sharepoint foundation server 2010 using visual studio 2010?

I donot want to use default form "form.aspx".

we can use my custom form in place of "form.aspx"?

SharePoint 2010- Custom Fields Like Rating Control- Need Suggestion on Saving Data


Hi All,

I am in process of Developing a Custom Field for Rating control. Requirements are below.

1) This field will be used for Creating survey

2) It will be called Rating control with Attribute ( some enhancement over out of box rating control)

3) Respondent will rate each attribute for 1 question like

                Action: 3

                Comedy: 5

                Thriller: 7

I need suggestion on  How to save data for above Requirements. I have designed control and it works fine. Only thing I need help on How to and Where to Save data related to answer?


Thanks in Advance



Pathik Rawal Blog: http://pathikhrawal.wordpress.com

Provision an InfoPath form template in a content type, with "view in browser" option

Hi all.
I've to provision an InfoPath form template in SharePoint 2010 within a content type, and my form must be open in a browser.
The provision of the .xsn file and of the content type goes well, but my form always open in the client and not in the browser. Instead, if i publish my form from InfoPath 2010 using the "Publish" option and i select to publish my form within a content type, everything goes well. I can see the form in the browser.

Here is my code.


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
 <Module Name="OpeningJeans" Url="_cts/MY CONTENT TYPE" RootWebOnly="TRUE">
  <File Path="InfopathModules\MyForm.xsn" Url="MyForm.xsn" />


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Form (0x010101) -->
 <ContentType ID="0x0101

How to use Data view form parameter



I have secure web site and I want to pass a parameters from web part to another web part in another page, and I tried to use web part connection to pass the value but I found that my parameters passed through the URL and this not work for me,


Anyone know the best way to pass these parameters to my web part in secure way? Any see that there is a form parameters on the data view web part, anyone know how it work?


Please it's urgent.

Thanks for all

ModalpopupExtender to display dynamic content from database and content from form's control


Dear All,


I have a grid, in that i have edit button column, If user wants to click on the edit button I need to open a modal window to display the records for the particular row data from database.


And also I am using SMS form to send sms, If user click on the send button I need to open the modal window and to dislpay a preview of the sms from the textbox of the same form.


Please help me to achieve these two functionality.


Thanks in advance.




Arun Kumar

Hide style library form view all site content



We have upgrade our MOSS 2007 server to SharePoint 2010. We keep it in MOSS2007 Competible mode, so that end user cant see any changes.

But after upgrading, we have found "style library" in document library, which was not present in our moss 2007 server. It is an publishing feature of MOSS2007.

Now we want to hide this "style library" from the document library, we have deactivated publishing feature on site collection and site level. But still, we are not able to hide or deactivate the "style library". Can anyone tell why it is so and provide solution to hide this?

Any help appreciated!!!

Thanks in advanced!!!

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend