Web Server Controls->ASP.NET HyperLink Control

Definition and Usage

The HyperLink control is used to create a hyperlink.


Properties

Property Description
id A unique id for the control
ImageUrl The URL of the image to display for the link
NavigateUrl The target URL of the link
runat Specifies that the control is a server control.  Must be set to "server"
Target Where to open the target URL.
  • _blank - the target URL will open in a new window
  • _self - the target URL will open in the same frame as it was clicked
  • _parent - the target URL will open in the parent frameset
  • _top - the target URL will open in the full body of the window
Text The text to display for the link

Examples

Hyperlink
ASPX Source:

<html>
<body>

<form runat="server">
<asp:HyperLink
ImageUrl="/banners/w6.gif"
NavigateUrl="http://www.w3schools.com"
Text="Visit W3Schools!"
Target="_blank"
runat="server" />
</form>

</body>
</html>
Output Result:
Visit W3Schools!
IF you click the image upside , the navigator will redirect to the url http://www.w3schools.com

In this example we declare a HyperLink control in an .aspx file.

posted on 2007-03-27 09:15  改变热爱  阅读(301)  评论(0)    收藏  举报

导航