This project has moved and is read-only. For the latest updates, please go here.

SPRedirectWithID in SharePoint 2010

Aug 16, 2011 at 4:22 PM

Hi all,

Just wondering if anyone has been able to get SPRedirectWithID (NewForm to EditForm) working in SharePoint 2010.

I have read through the documentation and have got a alert popping up declaring that js etc are present and in the correct folders but I cannot get the redirect working on any lists, custom or otherwise.

I did notice that you had to have a redirect already placed on the save button, and whilst I'm not entirely sure where I should be pointing this redirect to, I have tried to point it to different location and still no joy.

If anyone has had any better experience with SP 2010 and can point me in the right direction I would be very grateful.




Aug 16, 2011 at 4:35 PM


The function ought to work in SharePoint 2010, but the crux of the matter is what happens with the dialogs; that's the big caveat. The only way it can really work and not leave the user off in a corner somewhere is to turn off the dialogs for the list forms, which you can do in the list settings.


Aug 17, 2011 at 10:11 AM

Hi Marc,

Switching the dialog for the list is not something that my customer would be happy with so unfortunately that workaround seems to be a no goer with me, (I couldn't get the redirect working that way anyhow).


However, thanks for the pointer.

A poosible workaround would be, if the user where to click 'save/submit' button which would save thee details that are currently on the form but not close the form, i.e. keep it up on screen available for edit. 

Has anyone tried anythign like that before?



Aug 17, 2011 at 1:56 PM


That would be a different approach, but I haven't tried it. Ther trick for me with the Middle Tier scripting stuff in SPServices is to build generic functions that will work in 99% of the cases. You can certainly hard-wire something for one form which will do exactly what you want.


Aug 17, 2011 at 4:13 PM

Hi Mark,

I got a redirect working (in a way) using your own blog post (, however the editForm when opening in the modal dialog box, opens the entire site page (if that makes sense?).

I take it that is what you mean by the problem with having to switch off dialog in 2010.

I was close to a solution too.

Thanks for your input.


Aug 22, 2011 at 11:19 PM

Ah marks god ole method, it does indeed make sense it opens the entire page. You need to add the parameter IsDlg=1 to your url on the intermediate page Phil, like this: document.location.href = &apos;<xsl:value-of select="$RedirectURL" />&apos; + &quot;?ID=&quot; + &apos;<xsl:value-of select="@ID" />&apos; + &quot;&amp;IsDlgD=1&quot;

As for SPRedirectWithID on SP2010 it didn't work for me either, though I didn't really looked into it.

Mar 4, 2014 at 7:54 PM
I've gotten it to work in SP 2010, but like Marc says, you have to turn off modal dialogs for the list, because otherwise the page you are redirected to stays in the modal window.