SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In SharePoint 2007 in some occasions i see that when im redirected to some pages etc, i see a source in query string, and this i can use to be redirected back to the original page.

I've read on msdn that it exists and in url i can say something like:{Source}

But the token is not being replaced, maybe it is because in SP 2007 it isn't supported. This what i have in custom action:

<UrlAction Url="~site/_layouts/myAppPage.aspx?listid={ListId}&amp;source={Source}"/>

The result will be: page?listid=10&source={Source}

Any idea how can I get the source working in this case?

share|improve this question
up vote 1 down vote accepted

You need to substitute a value for {Source} with a valid URL to somewhere. Typically I use JavaScript to do this so I can get the page I am on using document.location.

For example, if I wanted to return them to the original page after completing an action I would use some JavaScript in the URL action like:

<UrlAction Url="javascript:window.location='~site/_layouts/myAppPage.aspx?listid={ListId}&amp;Source='+window.location" />

If the URL is persistent then you could just add it in there obviously.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.