Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query strings and underscores

Status
Not open for further replies.

tcstom

Programmer
Aug 22, 2003
235
GB
Hi,

I'm using the System.Web.HttpContext.Current.Request.QueryString collection as part of a method but am getting some odd behaviour if any of the query string names contain an underscore. For example, if the URL is
Code:
contact.aspx?page=1&customise=true&keepThis=true&TB_iframe=true&height=400&width=650&refreshParent=true
then System.Web.HttpContext.Current.Request.QueryString.ToString() returns
Code:
"page=1&customise=true&keepThis=true&"
but if the underscore is removed from the URL as follows
Code:
contact.aspx?page=1&customise=true&keepThis=true&TBiframe=true&height=400&width=650&refreshParent=true
then System.Web.HttpContext.Current.Request.QueryString.ToString() returns
Code:
"page=1&customise=true&keepThis=true&TB_iframe=true&height=400&width=650&refreshParent=true"

Anyone know what that's about? I need the query string with the underscore in there because it's part of the Javascript library Jquery's thickbox functionality...
 
My apologies. It turns out that the Jquery script was manipulating the target URL, and because it was being displayed in a thickbox ( I couldn't see that the querystring had been changed before the page was even requested. Sorry for wasting your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top