- HyperLink Web Server Control
in ASP.NET environment,The HyperLink Web server control is such similar to the HTML anchor tag except that which creates and manipulates links on a Web page from server code. This article describes you that how to work with HyperLink web control.
Advantages of HyperLink
- The major advantage of a HyperLink control is that you can customize the link properties in server code. For example, you can dynamically change the link text or target page based on conditions in your page.
- Another advantage of using the HyperLink control is that you can use data binding to specify the target URL for the link
To add a HyperLink to a Web page
- Add an <asp:HyperLink> element to the page.
- Specify the essential property of the HyperLink.such as Text,Id, etc
- Set the NavigateUrl property to the URL of the page to which you want to link.
the following code snippets describes how to set the Property of HyperLink via programmatically.
-
protected void Button1_Click (object sender, System.EventArgs e)
{
this.HyperLink1.Text = "Contact";
this.HyperLink1.NavigateUrl = "http://www.yoursite.com";
}
-
- Related Links
-
6701626d-2074-4e69-8061-12490f952b25|0|.0