0

How do i access querystring value in XSLT style sheet.

Say For Example:

my url is : http://localhost:54279/SearchResults.aspx?trip=on&ad=1&ch=0&in=0...

then how to get value of 1 from "ad"

I tried

 <xsl:param name="ad" select="ad" />
 <xsl:value-of select ="$ad"/>

But none of them worked..Any help please..

Sasidharan
  • 3,676
  • 3
  • 19
  • 37

1 Answers1

1

If you passed the whole url as a parameter

<xsl:param name="url" />

then you could use combination of substring-before and substring-after functions

<xsl:variable name="ad" select="substring-before(substring-after($url,'&ad='),'&')" />
Jirka Š.
  • 3,388
  • 2
  • 15
  • 17
  • I'm not .net expert but following link http://stackoverflow.com/a/1521090/1324394 should be what you need. – Jirka Š. Oct 09 '13 at 11:29