|
|
Rank: Devotee
Joined: 12/11/2006 Posts: 47
|
Hi, I am just wondering if it is possible to set a default querystring on a certain page? Let's say I have this link www.example.com/products.aspx?id=1087 - How can I ensure that I always start on this querystring instead of www.example.com/products.aspx. ??
/Jan
|
|
 Rank: Devotee
Joined: 1/10/2008 Posts: 75 Location: London
|
What are you looking to achieve exactly ? Do you want product ID=1087 to be the default ? In that case, you could just check when the page is loading that if Request["id"] == null then use id = 1087 Does it helps ? seb http://www.be-k.net
|
|
Rank: Devotee
Joined: 12/11/2006 Posts: 47
|
Hi Sebastien,
I get the idea, but I am not sure how to do it in the XSLT. Do you have any advice on that?
/Jan
|
|
 Rank: Devotee
Joined: 1/10/2008 Posts: 75 Location: London
|
Ah sorry I didn't see your were referring to XSLT. There might be a more straightforward way but I suppose you could use this example: http://umbraco.org/documentation/books/extending-xslt-with-c-or-javascript/extending-using-c-sharp">http:// http://umbraco.org/documentation/books/extending-xslt-with-c-or-javascript/extending-using-c-sharpwhere you can implement some server side code to read your request variable and default it to your needs. seb http://www.be-k.net
|
|
 Rank: Umbracoholic
Joined: 9/8/2006 Posts: 1,698 Location: KY, USA
|
You could do something like this to get the querystring value and set it to a default value if it doesn't exist... Code: <xsl:variable name="ProductId"> <xsl:choose> <!-- set default value --> <xsl:when test="string(umbraco.library:RequestQueryString('id')) = ''">1087</xsl:when> <xsl:otherwise> <xsl:value-of select="umbraco.library:RequestQueryString('id')"/> </xsl:otherwise> </xsl:choose> </xsl:variable>
cheers, doug.
MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
|
|
|
Guest |