fetching querystring value and pass to anchortag href

Posted by Neer under ASP.NET on 3/16/2012 | Points: 10 | Views : 9781 | Status : [Member] | Replies : 5
hi

i am passing one url in querystring , on the otherpage in aspx i want to fetch that string and apply to <a href="Querystring value">

how to do that?

-Neer


Responses

Posted by: Hmanjarawala on: 3/16/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi nirali,

I'm not getting your exact requirement, but if you want to fetch QueryString Data then you can use Request.QueryString which gives you NameValueCollection of Querystring daya.

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/16/2012 [Member] Silver | Points: 25

Up
0
Down
Hi Neer,
You can create a Anchor Dynamically using StringBuilder where you can use the querystring value.
For more go through this:
http://stackoverflow.com/questions/3043654/why-use-tagbuilder-instead-of-stringbuilder

Thanks,
Sanjay

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 3/16/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

you can get querystring data by Request.Querystring[""] and pass this into url of a href.



R D Patel

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 3/16/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

or you can directly send that wuery string in anchor tag using <%# %> syntax

thanks

R D Patel

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 3/16/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

you can use as follow

<a href='<%#"Default.aspx" + Request.QueryString["Id"].ToString() %>'>hi</a>


please Mark as Answer if it helps

Thanks

R D Patel

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response