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 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:
    ',/dsQueryResponse/Rows/Row/@ID,'

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:

https://domain.com/SitePages/Page.aspx?SelectedID=%27,/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
add comment

1 Answer

up vote 1 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_}')}" />

with

<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
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.