Passing Value on URL

  • Thread starter Thread starter - Steve -
  • Start date Start date
S

- Steve -

I can't find the answer to this because I don't know what it's called.

I want to e-mail my users a link that is customized to them. For example I
want them to click on the link and have the E-mail Textbox already filled
out with their e-mail address.

So I believe I want to send them a URL that looks something like
http://site.com/[email protected].

How do I grab that e-mail address in my ASP.NET page though?

--

Steve Evans
Email Services
SDSU Foundation
(619) 594-0708
 
The variables contained in a URL are called querystring variables. You can
access it using the Request.Querystring collection. In C# it would be like:

string strEmail = Request.QueryString["Email"].ToString();

To guarantee success though, you'll need to test for the querystring
variable being null like so:

stirng strEmail = "";
if(Request.QueryString["Email"] != null)
{
strEmail = Request.QueryString["Email"].ToString();
}

Hope this helps
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
Back
Top