I’m not sure why am I getting such result.
If I load the following URL into a browser:
http://localhost:57845/app.ashx?n=update&url=some_url&logo=long_logo_name
where the app.ashx file contains this code:
public void ProcessRequest(HttpContext context)
{
string strURL = context.Request.Params["url"];
}
My strURL variable becomes some_url,/app.ashx. Any idea why?
This is because the
Paramsproperty “gets a combined collection of QueryString, Form, Cookies, and ServerVariables items” (see http://msdn.microsoft.com/en-us/library/system.web.httprequest.params.aspx).You should use
context.Request.QueryString["url"]to get only “some_url”.