Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to assign href to anchor tag in codebehind c#

Tags:

c#

c#-4.0

The text I inserted in database is

 You also have to click on is <a href="" target="_blank"> link </a>

This text I am assigning to the label when page loads. My requirement is when I click the "link" I need to redirect to certain page. How can I set the href to the above code in code behind .

like image 492
lakki Avatar asked Dec 27 '12 09:12

lakki


1 Answers

Try to use HyperLink.

 <asp:HyperLink id="hyperlink1" 
                  ImageUrl="images/pict.jpg"
                  NavigateUrl="http://www.microsoft.com"
                  Text="Microsoft Official Site"
                  Target="_new"
                  runat="server"/>       

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hyperlink.aspx

like image 101
halit Avatar answered Nov 03 '22 00:11

halit