ASP.NET HyperLink Control.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
The ASP.NET HyperLink control is used as expected as a hyperlink to another webpage. The ASP.NET Hyperlink control allows for text hyperlinks or image hyper links. With the text only Hyperlink control, the Hyperlink is rendered as the
HTML anchor (a) element, with the image Hyperlink, the Hyperlink is rendered as the HTML anchor (a) with an image element embedded between the opening and closing tags.
Working example.
Text only Hyperlink.
Google
Working example.
Image Hyperlink.

Creating the text HyperLink control.
< asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="http://www.google.com" Target="_blank">Google</asp:HyperLink>
The above example will be rendered as HTML with the result below (source).
<a id="ctl00_ContentPlaceHolder1_HyperLink1" href="http://www.google.com" target="_blank">Google</a>
Creating the image HyperLink control.
< asp:HyperLink ID="HyperLink3" runat="server" ImageUrl="~/ASP/images/Google.gif" NavigateUrl="http://www.google.com" Target="_blank">Google</asp:HyperLink>
The above example will be rendered as HTML with the result below (source).
<a id="ctl00_ContentPlaceHolder1_HyperLink2" href="http://www.google.com" target="_blank"><img src="images/Google.gif" alt="Google" style="border-width:0px;" /></a>
|
|