QueryStrings: Content Management Server 2001 Overwrites the Value If the Variables Do Not Have Distinct Names (315782)



The information in this article applies to:

  • Microsoft Content Management Server 2001

This article was previously published under Q315782

SYMPTOMS

Users cannot retrieve QueryString items from the collection when all of the variables have the same name.

For example, if you pass the following QueryString to page
http://<server_name>/page1.asp?d=1&d=2&d=3
				
and then you access the value of variable "d" by using the following QueryString collection item
e.g.
Request.QueryString("d")
				
the result is "1,2,3". This is the result when you use this code on a static ASP page; however, if you use the same code in a Content Management Server template, you only get the last item in the collection.

CAUSE

When a Content Management Server template stores the QueryString of "d", it stores it as a string and value pair. It overwrites the value if the string "d" already exists; therefore, "d" returns "3".

WORKAROUND

To work around this issue, use the following code to parse out the whole QueryString to get "page1.asp?a=1&a=2&a=3":
<% =Request.Querystring("NROriginalURL")%>

Modification Type:MajorLast Reviewed:5/1/2002
Keywords:kbprb KB315782