I have a C# handler and I am trying to read the threadID value out of the querystring in one of my overriden methods but the result is always null, I have tried the following;
I have a silverlight upload control that uses a handler to upload the files to the server. I am not using the ProcessRequest in the handler I have to overrride a mehtod that is recommended by control maker. I have the threadID value in my querystring but
when I step through my code the value is always null. I have tried the following ways to read the threadID out of the querystring with no luck:
I am not using the ProcessRequest in the handler I have to overrride a mehtod that is recommended by control maker.
Then you should ask the control maker for some help/support. As it is, what you describe doesn't make a lot of sense. In the normal course of events, if you can see the querystring, it will be accessible via the HttpContext, but if some control designer
has abstracted that context into something odd, there's no way we can guess where it might be. You could of course step through the code and dig around.
iisnewbie11
Member
20 Points
10 Posts
reading querystring value in C# handler
Apr 20, 2011 09:09 PM|LINK
I have a C# handler and I am trying to read the threadID value out of the querystring in one of my overriden methods but the result is always null, I have tried the following;
string threadID = HttpContext.Current.Request.QueryString["threadID"];
string threadID = this.Request.Form["threadID"];
string threadID = this.Request.QueryString["threadID"];
Any ideas what?
Mikesdotnett...
All-Star
154858 Points
19858 Posts
Moderator
MVP
Re: reading querystring value in C# handler
Apr 20, 2011 09:39 PM|LINK
Can you actually see the querystring value in the URL (using eyeballs, Fiddler or similar)?
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
iisnewbie11
Member
20 Points
10 Posts
Re: reading querystring value in C# handler
Apr 20, 2011 11:08 PM|LINK
Yes, I can, that is what puzzles me.
chohmann
Star
9385 Points
1644 Posts
Re: reading querystring value in C# handler
Apr 21, 2011 05:40 AM|LINK
Can you show us the code?
karan@dotnet
All-Star
26228 Points
4596 Posts
Re: reading querystring value in C# handler
Apr 21, 2011 05:53 AM|LINK
Is that a webhandler that you are using?
Karan
~ Blog ~
Remember To Mark The Post(s) That Helped You As The ANSWER
iisnewbie11
Member
20 Points
10 Posts
Re: reading querystring value in C# handler
Apr 22, 2011 08:39 PM|LINK
I have a silverlight upload control that uses a handler to upload the files to the server. I am not using the ProcessRequest in the handler I have to overrride a mehtod that is recommended by control maker. I have the threadID value in my querystring but when I step through my code the value is always null. I have tried the following ways to read the threadID out of the querystring with no luck:
string baseThreadID = base.Request.QueryString["threadID"];
string contextThreadID = base.Context.Request.QueryString["threadID"];
string threadID = Context.Request.QueryString["threadID"];
//string threadID = HttpContext.Current.Request.QueryString["threadID"];
//string tID = this.Request.Form["threadID"];
//string thID = this.Request.QueryString["threadID"];
//string threadID = Request.QueryString["threadTypeID"];
Any ideas?
jpderooy
Member
459 Points
106 Posts
Re: reading querystring value in C# handler
Apr 22, 2011 09:07 PM|LINK
Normally you would het the values from teh current context. Is the current context available when not using the ProcessRequest?
Jean-Pierre
Feel free to follow me on Twitter!
Mikesdotnett...
All-Star
154858 Points
19858 Posts
Moderator
MVP
Re: reading querystring value in C# handler
Apr 23, 2011 06:39 AM|LINK
Then you should ask the control maker for some help/support. As it is, what you describe doesn't make a lot of sense. In the normal course of events, if you can see the querystring, it will be accessible via the HttpContext, but if some control designer has abstracted that context into something odd, there's no way we can guess where it might be. You could of course step through the code and dig around.
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter