0

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?

1 Answer 1

4

This is because the Params property "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".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.