ASP.NET Syntax ASP.NET Syntax for Web Controls
Creates a link on the page that users can click to move to another page.
Declarative Syntax
<asp:HyperLink
AccessKey = "string"
BackColor = "color name | #dddddd"
BorderColor = "color name | #dddddd"
BorderStyle = "NotSet | None | Dotted | Dashed | Solid | Double | Groove |
Ridge | Inset | Outset"
BorderWidth = size
CssClass = "string"
Enabled = "True | False"
EnableTheming = "True | False"
EnableViewState = "True | False"
Font-Bold = "True | False"
Font-Italic = "True | False"
Font-Names = "string"
Font-Overline = "True | False"
Font-Size = "string | Smaller | Larger | XX-Small | X-Small | Small |
Medium | Large | X-Large | XX-Large"
Font-Strikeout = "True | False"
Font-Underline = "True | False"
ForeColor = "color name | #dddddd"
Height = size
ID = "string"
ImageUrl = "uri"
NavigateUrl = "uri"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
runat = "server"
SkinID = "string"
Style = "string"
TabIndex = integer
Target = "string | _blank | _parent | _search | _self | _top"
Text = "string"
ToolTip = "string"
Visible = "True | False"
Width = size
/>
NOTE: The content of an <asp:HyperLink
> control can be defined within its opening tag. In this case, you can close the start tag with a trailing slash />
instead of using a separate end tag.
For information on the individual members of this class, see HyperLink in the class library.
The below code snippet demonstrates how to use a HyperLink control to move to another Web page.
<asp:HyperLink id="hyperLink1"
ImageUrl = "images/graphic.jpg"
NavigateUrl = "http://www.microsoft.com"
Text = "Microsoft Official Site"
Target = "_new"
runat="server" />
HyperLink Class HyperLink Web Server Control