Passing the name of the hyperlink or something???
Hello guys!!!
I have this problem in ASP. Well the logic is this:
I have 2 pages. One in HTML and one in .ASPX.
The HTML page has a hyperlink that say's Hello World.
I want to pass the Hello World value to the next page in ASP.
Please help me!!!
Here's the code:
The HTML page:
<td width="56%" CLASS="style13"><a href="WebForm2.aspx" name="Ian">Hello World</a></td>
The .ASPX page:
Dim a As String
a = Request.Form("Hello")
:thumb: :thumb: :thumb:
Re: Passing the name of the hyperlink or something???
I think there are 3 ways to pass info. Check out the excellent tutorial on ASP from here:
http://www.w3schools.com/default.asp
Re: Passing the name of the hyperlink or something???
Quote:
Originally Posted by dglienna
Hey thanks for the link. It helped a little.
But I still have one more question.
Is it possible pass the name of the HTML hyperlink to the querystring? If yes
then how?
Re: Passing the name of the hyperlink or something???
Please help me!!!!
:cry: :cry: :cry:
Re: Passing the name of the hyperlink or something???
well, isn't this possible?
href="WebForm2.aspx?name=Ian"
?
Re: Passing the name of the hyperlink or something???
Quote:
Originally Posted by wengang
well, isn't this possible?
href="WebForm2.aspx?name=Ian"
?
Well it did pass the string "Ian" but not the Hello World which is the intended
value.
:wave: :wave: :wave:
Re: Passing the name of the hyperlink or something???
OK.
so use the innerText property of the A Tag:
<a href="#" onClick="location.href='WebForm2.aspx?textvalue='+ this.innerText;">Hello World</a>
and on your target page, you can request("textvalue")
I'm not sure, but you may have to replace ("%20", " " ) to get your spaces back, maybe not.
Re: Passing the name of the hyperlink or something???
Hi,
To make things easy, why dont you just use the server variable
request.Servervariables("HTTP_REFERRER")
thisll pass the page name to to wherever you want it..
ta
kai :wave:
Re: Passing the name of the hyperlink or something???
Hey Kaihirst. Did you post this on the wrong thread? The one about the URL as parameter would be more suitable.
Re: Passing the name of the hyperlink or something???
Hi,
yeah wrong thread!!!
ta
Kai :wave: