SharePoint - Data View Webpart - Return your customer back to your Data View
After your customer links to and then submits the form, they are redirected to the default list view of the SharePoint list. For most scenarios, it makes more sense to have the customer return to the Data View from which they came. In order for this to happen, the URL that you jump to must include the Source=URL name/value pair. You can make the system add this name/value pair for you automatically by adding two attributes to your link.
- Create or open a Data View, and then switch to Split or Code view.
- Go to the <xsl:template name="dvt_1.rowview"> sub-node of the <WebPartPages:DataFormWebPart> tag.
- Locate the <a> tag that formats the field value. For example:
- Add the attributes to the <a> tag that enable the link to return the customer to this Data View. For example:
<xsl:value-of select="@Product_x0020_Name" />
Notice in the above example the onclick and target attributes added to the <a> tag.
- Add the Navigate to source form action to one or more buttons on the target form. For information on how to add this form action to your form, see the article Add a built-in form action to a Data View.