您的位置:首页 > 编程语言 > ASP

Web Server Controls->ASP.NET HyperLink Control

2007-03-27 09:15 507 查看

Definition and Usage

The HyperLink control is used to create a hyperlink.

Properties

PropertyDescription
idA unique id for the control
ImageUrlThe URL of the image to display for the link
NavigateUrlThe target URL of the link
runatSpecifies that the control is a server control. Must be set to "server"
TargetWhere 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

TextThe 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:



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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: