Asp. NET Hyperlink Hyperlink control Usage _ Basic Application

Source: Internet
Author: User
Tags eval

HyperLink (HYPERLINK)

Role: Responsible for navigating between pages

Property value function
NavigateUrl Url The page address (URL) that will be jumped
Font-underline False Get rid of hyperlink underline

Basic use of Hyperlink controls

Use the most is nothing but NavigateUrl, since is a hyperlink, must have a link address, the following see the specific usage:

Copy Code code as follows:

<%@ Page language= "C #" autoeventwireup= "true" codefile= "HyperLink.aspx.cs" inherits= "Webcontrols_hyperlink"%>

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<title></title>
<body>
<form id= "Form1" runat= "Server" >
<div>
<asp:hyperlink id= "Hlkmenu" runat= "Server" font-strikeout= "False"
Font-underline= "False" navigateurl= "~/webcontrols/checkboxlist.aspx" > check box Group page </asp:HyperLink>
</div>
</form>
</body>

Second, HyperLink NavigateUrl Hyperlink Data binding method

Hyperlink controls often appear in repeater controls, and link addresses are often backed by background data, and are implemented in two ways, as follows:

Copy Code code as follows:

<asp:hyperlink id= "HyperLink1" runat= "server" Navigateurl= ' <%# ' ~/sysmanage/rolemanage/distributerole.aspx? Roleid= "+databinder.eval (Container.DataItem," Roleid ")%> ' > Assigning Permissions </asp:HyperLink>

Copy Code code as follows:

<asp:hyperlink id= "HyperLink1" runat= "Server" imageurl= "Images/hammer_screwdriver.png" navigateurl= "<%#" Eval ( "UserId", "Userinfodetails.aspx?" userid={0} ")%> ' > User Details </asp:HyperLink>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.