Accessing Querystring in Custom Server Control

ToxChureTor

New Member
I'm trying to access values in the querystring in a custom server control I'm working on. I want the server control to be able to grab the value from the querystring and pull information from the database based on the value. When I try to use Request.Params("variablename") and compile the code, I get an error. Is there a specific class I need to import in order to be able to access this? Any help would be appreciated.<BR><BR>Thanks,<BR>../n1ck/to specify... i'm getting a "Name 'Request' is not declared." error. i'm importing the System.Web namespace too. any help is greatly appreciated. <BR><BR>thanks,<BR>../n1ck/You need to grab the current httpcontext. So either use HttpContext.Current.Request. Or create an object like so:<BR><BR>HttpContext oConx = HttpContext.Current;<BR><BR>Then use oConx.Request to get the querystring.thank you SSOOO much... that was bugging the hell out of me...<BR><BR>thanks again.Yeah, it bugged the hell out of me for awhile before I finally got it working. :)
 
Back
Top