HttpRequest parameter read

M

MuZZy

Hello,

I am developing a web application. If i call an aspx page with several
parameters, is there a way to get access to parameter values by key? I am
using C#

E.g.

void PageLoad(object sender, EventArgs e) {
string album = Request.<???>("album");
}

And a call the page: http://mywebsite.com/pics.aspx?album=FirstAlbum.

As i could see, it only provides methods to get a list of parameters and
then loop thru them.
Is there any direct way?

PS Sorry for cross-posting, i wasn't sure either to post the question to C#
or ASP.NET NG.

Thank you,
Andrey
 
G

Guest

String album = Request.QueryString["album"];

havent tried this, but should work

Kalpesh
 
C

Chris R. Timmons

Hello,

I am developing a web application. If i call an aspx page with
several parameters, is there a way to get access to parameter
values by key? I am using C#

E.g.

void PageLoad(object sender, EventArgs e) {
string album = Request.<???>("album");
}

And a call the page:
http://mywebsite.com/pics.aspx?album=FirstAlbum.

As i could see, it only provides methods to get a list of
parameters and then loop thru them.
Is there any direct way?

Andrey,

string album = string.Empty;
if (Request.Params["album"] != null)
album = Request.Params["album"].ToString();


Hope this helps.

Chris.
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top