Using parameters from URL as variables in XSLT Data View

November 18th, 2007 | Categories: Free tools, Software

This is a reply to PsychedEric in my post about QueryString. To use params from URL in an XSLT data view is quite simple. Once you have the data view inserted, display the options of the Data View and click on Parameters.

Next click the button “New Parameter” and enter a name for it. Then in a Parameter Source dropdown, select Query String.

 

Under the dropdown enter the variable name – which parameter in URL to read. For example if it will be reading parameter “p” in url webborg.blogspot.com?p=1234 just enter letter p. You can also set a default value if there is no p parameter in the URL.Next click OK.

And that’s it. Now you can use this parameter for filtering, or in the Data View Web part as you desire. If you want to use the parameter in the DataView just enter its name with a $ (dollar) sign before it. SharePoint Designer’s Intellisense will recognize it.