Using HTTP Parameters with C# and .NET

P

Peter

I have a question as below:
.. one.htm calls two.aspx page with parameter as below:
.. two.aspx?para1=hello
.. in two.aspx.cs file, how do I use the parameter?
Please advice.
 
V

Visual Barty

Peter -

This is how you would access parameters passed through the querystring:

Request.Querystring("para1")

Hope this helps.

Bart A. Robinson, MCP
 
M

Munsifali Rashid

In the Page_Load function, you can read this value into a local variable.
Eg.

string strParam = "Default Value";

if (Request.QueryString.Get("para1") != string.Empty)
{
strParam = Request.QueryString.Get("para1")
}

Hope this helps,

Mun
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top