Using C# & Java Script
I have the link like this
"http://localhost/Server/Vehicle/Vehicle.aspx?appid=5", when i use this link the page is opening… But i want to get this appid value, then pass this appid value to another link
In the above link appid value is 5
For Example
Link1 http://localhost/Server/Vehicle/Vehicle.aspx?appid=5
In link2 the value 5 should display like this “http://localhost/Server/Vehicle/car.aspx?appid=5“
Tried Code
<a href="car.aspx?param=document.getElementById('appid').value">Entry</a>
But in another page the link is displaying like this
http://localhost/Server/Vehicle/car.aspx?param=document.getElementById('appid').value
How to get that appid value. I want to pass this value to another link
Need code Help
Access the
Request.QueryStringas follows to retrieve the value of theappidquery variable:Update:
The JavaScript snippet won’t be executed in the
hrefattribute of a link (it’s recognized as a normal string, and won’t be parsed as JavaScript code).With the following link a user will be successfully directed to your desired URL:
Side note: the
valueproperty works only for HTML tags that have defined an eponymous attribute. One such tag would be theinputtag. Thedivtag instead doesn’t have avalueattribute defined, and thereforedocument.getElementById('appid').valuewould fail; useinnerHTMLinstead in that case.