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

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

 <CustomAction
      Id="Navigate.DisplayMenu"
      Title="Navigate to:"
      RegistrationType="ContentType"
      RegistrationId="0x010100AEAD1A170E39D343BE3252ECF5B97"
      GroupId="ActionsMenu"
      Location="DisplayFormToolbar"
      Sequence="100">
    <UrlAction Url="javascript:window.location='{SiteUrl}/_layouts/Pages/InterPage.aspx?listid={ListId}&amp;itemid={ItemId}&amp;source='+window.location" />
  </CustomAction>

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

share|improve this question
    
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.as‌​px?listid={ListId}&amp;itemid={ItemId}&amp;source='+window.location)" /> –  Jigs Apr 17 '13 at 8:05

2 Answers 2

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

share|improve this answer
    
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
up vote 0 down vote accepted

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;"/>
share|improve this answer

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.