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

I have two DataFormWebparts on a page, one for creating new objects, one to edit them. The Webpart that creates them has this button :

<input type="button" value="Save" name="btnSave0" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__refresh;__redirect={Page.aspx?SelectedID_x003D__x007B_@ID_x007D_}')}" />

The actions for the button I have set from Sharepoint Designer 2010, as follows:

  • Commit
  • Refresh
  • Navigate to page (same page but with parameter SelectedID set with value:

The logic that should happen is: save the object, then redirect to the same page but with the ID of the newly created object in the XsltListviewWebPart.

What actually happens, the redirect works but to:,/dsQueryResponse/Rows/Row/@ID,%27

I see two problems, first -the redirected URL seems to be encoded. Second, the parameter is simply taken as string, not considered as an actual parameter.

Can anyone please give a hint on what's going on?

share|improve this question
up vote 2 down vote accepted

try replacing this:

<input type="button" value="Save" name="btnSave0" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__refresh;__redirect={Page.aspx?SelectedID_x003D__x007B_@ID_x007D_}')}" />


<input type="button" value="Save" name="btnSave0" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__refresh;__redirect={Page.aspx?SelectedID={@ID}}')}" />

if that doesn't works, you can use substring(@ID,[start-index],[length]) or substring-after or substring-before in xslt

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.