I have a strange issue, basically, I have the following custom action:

      Title="Navigate to:"
    <UrlAction Url="javascript:window.location='{SiteUrl}/_layouts/Pages/InterPage.aspx?listid={ListId}&amp;itemid={ItemId}&amp;source='+window.location" />

Based on content type this custom action appears in DisplayForm, but the problem is when i click it, it does'nt redicrect to another "InterPage.aspx", the page just refreshes and that is it ...

Any idea what the problem could be?

Note: it is for sharepoint 2007

  • Its seem to work on 2010.strange issue in 2007. but can you try this : <UrlAction Url="javascript:void(window.location.href='{SiteUrl}/_layouts/Pages/InterPage.aspx?listid={ListId}&amp;itemid={ItemId}&amp;source='+window.location)" /> Apr 17 '13 at 8:05

Try using window.loaction.href in UrlAction for redirecting.

  • i tried, but it is still the same behaviour :( no success
    – Shkipper
    Apr 17 '13 at 7:35
  • When you click on that button, there is no change in your page URL right? It means UrlAction is not called. Else if changed try navigating to any test page.
    – Suren
    Apr 17 '13 at 7:47
  • Try this..<UrlAction Url="javascript:void(window.open('google.com','_blank'))">
    – Suren
    Apr 17 '13 at 7:56
  • Oh, yes, this does work!, but yea again it opens a new window but i have to redirect on current
    – Shkipper
    Apr 17 '13 at 9:54
  • Then use _self instead of _blank.
    – Suren
    Apr 17 '13 at 10:10

I solved the issue having the following url:

 <UrlAction Url="javascript:function GoToUrl(){var site='{SiteUrl}';var item='{ItemId}';var list='{ListId}';window.location.href=site+'/_layouts/Pages/InterPage.aspx?list='+list+'&amp;ID='+item};GoToUrl();return false;"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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