Using QueryString variables within a Content Query Web Part (CQWP)

To get access to a querystring variable in the CQWP:

In the code for the content query web part, add the bold section below:

<WebControls:ContentByQueryWebPart runat=…………..

</DataFields>

<parameterbindings>

<ParameterBinding Name=”formId” Location=”QueryString(ID)” DefaultValue=”empty” />

</parameterbindings>

 

In itemstyle.xsl, find the existing xsl:param towards the top of the file, and add this below it:

<xsl:param name=”formId” />

 

Within the xsl, use the param as necessary with the following statement:

<xsl:value-of select=”$formId”/>

 


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s