0

I have this url-link : http://localhost:50201/CastingForms/CastingList.aspx?name=<a>.

How can I get parameter name.

For now I use this code sname = Request.QueryString["name"];

But it returns ""(empty result).

I used System.Web.HttpUtility.HtmlEncode to encode name.

2 Answers 2

2

Without knowing what version of Net. Here is a possible solution.

  var queryValues = Request.RequestUri.ParseQueryString();

Then just access query values like a Dictionary collection.

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

Comments

1

To redirect new url; I did not encode the html tag. I encode on other page. I transfer as string (http://localhost:50201/CastingForms/CastingList.aspx?name=<a>)

I make some changes in web-config file.

<httpRuntime targetFramework="4.5" executionTimeout="100000" maxRequestLength="214748364" requestValidationMode="2.0" />
<pages validateRequest="false">

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.