Friday 11 July 2014

Redirecting to a page from a list form button through SharePoint Designer

There are times when you want to redirect to a different page after adding a new item in a list. Here I have done this by creating a new list form and editing the default close/save button using SharePoint Designer. The steps are as below

  • Open the list in share point designer and create a new list form 


set the new form as default list form


  • Edit the form in advance mode.
  • If you want to redirect Close button URL, Search for SharePoint:GoBackButton. Delete the default close button and insert SharePoint form action button from the ribbon bar.  



 select navigate to the page from action list and click settings to specify your URL. If you take a look at the  code behind of the button you will see the following:
                        
<input name="close1" type="close" value="close" onclick="javascript: {ddwrt:GenFireServerEvent('__redirect={Test.aspx}')}"
  • If you want to redirect Save button URL, Search for  SharePoint:SaveButton. Delete the default save button and insert SharePoint form action button from the ribbon bar.  Select Commit and Navigate to page (in this order). Select the Navigate to page (right side) and click settings to specify your home page. 
          If you take a look at the code behind of the button you will see the following:   
  <input name="save1" type="save" value="save" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={Test.aspx}')}"
  • Save and Test

No comments:

Post a Comment