I've used a parameter in the query string to filter a dataview. The parameter is declared in "SelectParameters" tag and used in the "selectcommand" parameter as a filter in the query.

Now, is there a way to use that parameter in the "XSL" tag? I tried : <xsl:value-of select="$PARAM" /> <xsl:value-of select="@PARAM" /> <xsl:value-of select="{PARAM}" /

And it doesn't work... I'm with Sharepoint 2007.

3 Answers 3


OK, I forgot something in the dataview definition...

First, you have to put a line like :

<WebPartPages:DataFormParameter Name="PARAMNAM" ParameterKey="PARAMNAME" PropertyName="ParameterValues" />

Inside the XSL tag, at the beginning, you need (that's what I forgot) :

<xsl:param name="PARAMNAME">DEFAULT VALUE</xsl:param>

And you also need, in parameterbindings :

<ParameterBinding Name="PARAMNAME" Location="QueryString(PARAMNAM)" DefaultValue="DEFAULT VALUE" />

Now to output the value, for example, you can do :

<xsl:value-of select="$PARAMNAME" />


If the query string parameter is in the parameter bindings and listed as a param, you should be able to use it as <xsl:value-of select="$PARAM" />


Very doable from the SharePoint Designer GUI. See Laura Rogers' blog post on this:


Inspect the XSL generated to see how it works.

  • The link doesn't work here :(
    – user2518
    Feb 28, 2011 at 18:10
  • Apologies, wrong link! Updated.
    – James Love
    Feb 28, 2011 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.