Microsoft Developer Network > 포럼 홈 > SharePoint - Design and Customization > Passing parameters from a dataview via querystring
질문하기질문하기
 

답변됨Passing parameters from a dataview via querystring

  • 2009년 7월 3일 금요일 오후 9:24prostration 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    I have a dataview that displays the items from a list. I inserted a column and added a hyperlink, from there I added whatever parameters I wanted to pass, this works great. Now how can I do this with a button instead of a hyperlink? I tried to do it by adding a button instead of a hyperlink to my new column and placing this code inside my button: document.location.href = ('http://something/something.aspx' + <xsl:value-of select="@whateverparameteriwanttopass"/>)

    However instead of getting the specific value for the parameter of the row where I click the button like it does with the hyperlink, it always gives me the value of the last item in the dataview. How can I fix this?

답변

  • 2009년 7월 3일 금요일 오후 9:56Mchova01 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

    Try replaing the code to create your button with the following:

    <INPUT TYPE="BUTTON" VALUE="Button Title" ONCLICK="window.location.href='http://something/something.aspx?ID={@ID}'"/>

    Replace "?ID=" with the name of your parameter, (e.g. "?Myparameter=")
    Replace {@ID} with the column name used for the parameter source (e.g. {whateverparameteriwanttopass})

    This worked on my end.

    • 답변으로 표시됨prostration 2009년 7월 3일 금요일 오후 10:17
    •  

모든 응답