Grabbing paramter in the URL

  • Thread starter Thread starter Randy
  • Start date Start date
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
 
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)
 
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

Back
Top