Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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:

http://url.com?soruce={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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.