SaveButton RedirectUrl property does not work

This post might be useful for sharepoint designers who are using SharePoint Designer 2007. (SharePoint List related)
SharePoint SaveButton RedirectUrl property did not work for my SharePoint custom form pages.
I am not sure what causes it, but as a workaround you may want to replace the SharePoint SaveButton

<SharePoint:SaveButton runat="server" ControlMode="New" id="savebutton1" RedirectUrl= "http://www.google.com"/>


.with a Form Action Button..

<input type="button" value="OK" name="btnFormAction" onclick="javascript: {ddwrt:GenFireServerEvent(' __commit ;__redirect={http://www.google.com}')}" />


..the same applies to a GoBack button which will redirect you to the default SharePoint List view. You can replace the GoBack button..

<SharePoint:GoBackButton runat="server" ControlMode="New" id="gobackbutton1"/>


..with a Form Action Button which will only redirect to the desired page without saving any change made on your custom page..

<input type="button" value="Cancel" name="btnFormAction" onclick="javascript: {ddwrt:GenFireServerEvent(' __redirect={http://www.google.com}')}" />

Comments