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



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



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”/>




Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s