none
Save Button Redirect URL with Parameter RRS feed

  • 질문

  • I have a save button and I added a Redirect URL which works fine on the Create pages as I don't have an ID so I just send user back to the home page like this:

    <SharePoint:SaveButton runat="server" ControlMode="New" id="savebutton2" RedirectUrl="/sites/MySite"/>

    On the edit form I'd like to send the user to a View page where they can view their changes (Ultimately I'd like that on Save as well but don't have an ID so if that is possible BONUS). I've tried setting it up like this but it leaves the ID blank:

    <SharePoint:SaveButton runat="server" ControlMode="Edit" id="savebutton2" RedirectUrl="/sites/MySite/SitePages/View.aspx?id={@ListItemId}"/>

    Any ideas how I can include the parameter there? It is a querystring param if that makes a difference. I've also tried the <xsl:value-of select="@ID"/> but that just threw an error all together. And {@ID} leaves the value blank as well.


    • 편집됨 nighthawk75 2019년 10월 17일 목요일 오후 5:24
    2019년 10월 17일 목요일 오후 5:23

답변

  • Ah! I found some helpful information finally - but not here so I will share the solution I found. 

    Directly after the xsl:stylesheet declaration I added:

    <xsl:param name="ListItemId"></xsl:param>

    Then for my redirects I used:

    <SharePoint:SaveButton runat="server" ControlMode="Edit" id="savebutton2" RedirectUrl="/sites/MySite/SitePages/View.aspx?id={$ListItemId}"/>

    And Volia! Redirection to custom view form!

    • 답변으로 표시됨 nighthawk75 2019년 10월 17일 목요일 오후 5:55
    2019년 10월 17일 목요일 오후 5:55