HyperLink control in ASP.NET using VB.NET

This article shows the HyperLink control in ASP. NET.
  • 3578

This article shows the HyperLink control  in ASP. NET.

HyperLink control:

The HyperLink Web server control is used to create a link to another Web page. The text in the HyperLink control is specified using the Text property. We can also display a image on this control instead of text.

Properties: These are the following properties of the HyperLink control.

hl.gif
 

Figure 1.

Text - The text to be shown for the link.

ImageUrl - gets\sets The image to be displayed in the hyperlink.

NavigateUrl - The URL to navigate to when the hyperlink is clicked.

Target - The target property allows us to set new page/content to be displayed in a new browser window, same window, etc. The values are as follows:

_blank: displays the linked content in a new window without frames.
_parent: displays the linked content in the immediate frameset parent.
_self: displays the linked content in the frame with focus.
_top: displays the linked content in the full window without frames.

ToolTip - ToolTip displayed when the mouse is over the control.

For example:

Drag a hyperlink control on to the form. Select the control and open it's properties window. From the properties window set the NavigateUrl property to your favorite website (in the form http://www.google.com), Target property to _blank and Text property to some text. When you run the application and click the hyperlink your favourit website opens in a new window.

Form looks like this:

  hl2.gif

Figure 2.  
 

Now save and run the application. 

hl3.gif
 

Figure 3.
 

Now click on the above Link.

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.