Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

"<a href="http://www.xyz.com.sg/WebForm1.aspx?Name=" + PersonName.ToString() + ">Click Here</a>";


How to add one more field?

help pl

Regards,
Praveena
Posted

If you are talking about query parameters, you can use the & symbol to separate your parameters.
HTML
<a href="http://www.xyz.com.sg/WebForm1.aspx?Name=" + PersonName.ToString() + "&ID=" + PersonID.ToString() + ">Click Here</a>
 
Share this answer
 
Try something like this:
"<a href="http://www.xyz.com.sg/WebForm1.aspx?Name=" + PersonName.ToString() + ">Click Here</a>";


Good luck!
 
Share this answer
 
v2
like this:

<a href="http://www.xyz.com.sg/WebForm1.aspx?Name=" + PersonName.ToString() + "&age=12"  + ">Click Here</a>


You might want to read more about this.

http://en.wikipedia.org/wiki/Query_string[^]
 
Share this answer
 
Do this in your code behind:

public string thisUrlFormat = "<a href='http://www.xyz.com/WebForm1.aspx?Name={0}>Click Here</a>";


and when you need to use it in your HTML, do this:

<%=string.Format(thisUrlFormat, PersonName.ToString())%>


If you need to add more parameters, add the appropriate format specifiers to thisUrlFormat after "{0}":

"?AnotherParam={1}"

and change your html to look like this:

<%=string.Format(thisUrlFormat, PersonName.ToString(), 5)%>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900