Grabbing paramter in the URL

R

Randy

Hello,
I'm not sure if this is the place to post this, but...
In c#, I'm trying to find out how to grab a parameter from the incomming URL
using c#. I'm passing it in from another asp page in the URL.
Can someone tell me the mechanism to do this?

Thanks
 
P

Peter Chadwick (MCP)

Hi,

You'll be wanting to use the Request object. For example if you're URL
is:

mypage.aspx?Username=John

You can grab that info in C# on the target page by using something
like:

string myUser = Request.QueryString["Username"]

Regards,

Peter Chadwick (MCP)
(e-mail address removed)
 
E

Eliyahu Goldin

Example:

int id = System.Convert.ToInt32 (Request.Params["id"]);

Eliyahu
 

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
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top