![]() |
Passing Value on URL
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/page.aspx?Email=user1@domain.com. How do I grab that e-mail address in my ASP.NET page though? -- Steve Evans Email Services SDSU Foundation (619) 594-0708 |
Re: Passing Value on URL
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 "- Steve -" <sevans@foundation.sdsu.edu> wrote in message news:ehQXY0kVEHA.2716@tk2msftngp13.phx.gbl... > 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/page.aspx?Email=user1@domain.com. > > How do I grab that e-mail address in my ASP.NET page though? > > -- > > Steve Evans > Email Services > SDSU Foundation > (619) 594-0708 > > > |
| All times are GMT. The time now is 08:47 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.