My customer has a requiirement for simple wizard style (ie Next>>Next) navigation
Typical Example would be to enter details for a purchase order header, then to press "Next" and the user is taken immediately to the window for adding lines.
I found number of ways to manipulate the navigation options of a SharePoint edit form page these being:
1) You can add a source querystring parameter to the url of the first page. This allows you to enter details for the header and then get routed to the child page that you specify in the source querystring variable as per this post.
3. You could replace the sharepoint:savebutton with a standard asp.net button and wire it up to some inline inline C#. As mentioned in my example I wanted to save the data entered and add a runtime querystring parameter to the end of the url.
So. to achieve a simpl save and redirect you can implement the following :
1. Add your inline C# code to your SharePoint page (i.e.)
<script type="text/c#" runat="server">
void SaveAndRedirect(object sender, System.EventArgs e)
//Implement your own code for creating the url
string redirectUrl ="http://vsmoss?paramName=12345";
2. Add PageParserPath entry to your web.config. You will need to modify the virtual path to reflect the name and url of your custom page.
<PageParserPath VirtualPath="/Services/Lists/Calendar/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" />
3. Add your asp.net button to your page.
<asp:Button runat="server" Text="Button" id="Button1" OnClick="SaveAndRedirect"/>
You will need to restart IIS for the changes to take effect.
This technique is an extension to a post from Nick Swan who discusses inlining C# in master pages but isn’t too keen on thee idea. I'm open to suggestions as to whether standard aspx pages are candidates for this type of modification.
If you need simple navigation logic then this technique works. Of course there is more than likely a slicker solution that I haven’t thought of . I guess the most likely solution would be to create a SharePoint form control that inherits from one if the controls in the Microsoft.Sharepoint.WebControls namespace. I attempted this and managed to get it rendering in SPD but kept getting runtime errors that I couldn’t get to the bottom of. If anyone has implemented a custom SharePoint form button I'd love to find out how they got it working.