Properties of Hyperlink
The HyperLink control has four control-specific properties:
- NavigateUrl: The target URL to navigate to when the user clicks on the hyperlink.
- ImageUrl: Sets the path to an image displayed by the control rather than text set in the Text property.
- Text: The text string that will be displayed on the browser as the link.
- Target: Defines the window or frame that will load the linked page.
Making HyperLink Control using GUI
Here are the following steps to make Hyperlink control using Visual Studio GUI:
Step 1: First, Create an ASP.NET web application with two web forms.

Step 2: Create a new web page and drag and drop HyperLink Control on the web page from the toolbox.

Step 3: Set the HyperLink control Text property value to ‘Redirect Second Page,’ and it will be displayed on the hyperlink.

Step 4: Now, Set the NavigateUrl property of HyperLink control. Select or write the path of the destination page where we want to redirect when clicking the hyperlink control. Here, we select Default2.aspx as the second web page to which we will redirect from Default.aspx.

Output:
Default.aspx

Default2.aspx

After clicking on the Hyperlink
HyperLink through code
Client-side navigation means that when you click on a HyperLink, your browser (client) or HTML requests a web page. The HTML anchor tag <a> is rendered by the HyperLink control. The HyperLink's text is shown using the Text attribute.
Default.aspx:
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default2.aspx">
Redirect Second Page
</asp:HyperLink>
The above code will get the rendered HTML as given below:
<a id="HyperLink1" href="Default2.aspx">Redirect Second Page</a>
When a user clicks on HyperLink control, the browser calls the Default2.aspx web page.
FAQs
1. How should we name the value of the target property of Hyperlink?
The value of the target property is case-insensitive. It must begin with a character in the range of a—z, which starts with an underscore. Note that these are the standard HTML values for the target attribute of an <a> element.
2. What happens when the Text and ImageUrl properties are both set in the hyperlink?
If the Text and ImageUrl properties are both set, the ImageUrl takes precedence. The text will be displayed if the image is unavailable.
3. What happens when the tooltip property is not set for a hyperlink?
If the ToolTip property has not been set, the Text value will display as a tooltip. If the ToolTip property has been set, the ToolTip text string will display as a tooltip.
4. From where did HyperLink Class inherit?
The inheritance of HyperLink Class can be explained as follows:
Object–>Control–>WebControl–>HyperLink
(C# code)
public class HyperLink : System.Web.UI.WebControls.WebControl
5. What is the difference between HyperLink control and LinkButton control?
Once clicked, a HyperLink immediately navigates to the target URL without a postback. Meanwhile, a LinkButton will post back the form to the server once it is clicked and will only navigate to a URL if its Click event handler is written.
Key Takeaways
This article taught us about hyperlink control in ASP.NET, its properties, code, and practical implementation.
But this is not enough; you need something extra to excel in web development truly. If you want to learn more about web development, you can read our articles or take our highly curated Web Development course.
Apart from this, you can also expand your knowledge by referring to these articles on Features Of ASP Net and ASP Full Form.