Search code examples
sharepoint-2007

Showing the user a custom page after list add in Sharepoint 2007


After my user adds a new list item with my custom list page, Sharepoint 2007 redirects them to AllItems.aspx. I want them to go the the custom page ThankYou.aspx instead.

My buttos are the standard buttons generated by SharePoint Designer

<table>
    <tr>
        <td width="99%" class="ms-toolbar" nowrap=""><IMG SRC="/_layouts/images/blank.gif" width="1" height="18"/></td>
        <td class="ms-toolbar" nowrap="">
            <SharePoint:SaveButton runat="server" ControlMode="New" id="savebutton2"/>
        </td>
        <td class="ms-separator"> </td>
        <td class="ms-toolbar" nowrap="" align="right">
            <SharePoint:GoBackButton runat="server" ControlMode="New" id="gobackbutton2"/>
        </td>
    </tr>
</table>

I have seen several solutions that require adding 150 lines of JavaScript or changing the underlying SharePoint code, and I just can't believe that is the solution - I think either it is so simple that no one has written about it, or I am using the wrong search term to look for it.


Solution

  • I was just overlooking something simple.

    The Source parameter on the form link will change the redirect for you. So if your custom form is at

    https://myserver/lists/customadd.aspx
    

    Then you can just add the source parameter and Sharepoint will redirect there on submit:

    https://myserver/lists/customadd.aspx?Source=ThankYou.aspx