Redirect item added in sharepoint list

camllistsharepoint

how can i redirect to a "Thank You" page after a user has entered a new item into a custom list that I have provisioned.

one way i can think of is in the item adding event receiver but is there a CAML way of doing it?

Best Answer

You can use the "source" URL parameter.

For example, if the link to your list is:

http://server/SiteCollection/Site/Lists/MyCustomList/NewForm.aspx

Adding the Source URL parameter designates the next page:

http://server/SiteCollection/Site/Lists/MyCustomList/NewForm.aspx?Source=http://server/SiteCollection/Site/ThankYou.aspx

The downside to this, is that if they click cancel they will be redirected to this page as well. But you could probably alter this behavior with some JavaScript.