Passing Value on URL

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
 
M

Mark Fitzpatrick

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
 

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,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top