HtmlAnchor.HRef 속성

정의

HtmlAnchor 서버 컨트롤에 지정된 링크의 URL 대상을 가져오거나 설정합니다.

public:
 property System::String ^ HRef { System::String ^ get(); void set(System::String ^ value); };
public string HRef { get; set; }
member this.HRef : string with get, set
Public Property HRef As String

속성 값

String

링크의 URL 대상입니다.

예제

다음 코드 예제에서는 컨트롤을 HRef 클릭할 때 HtmlAnchor 탐색할 웹 페이지를 지정 하는 속성을 사용 하는 방법을 보여 줍니다.

<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
   
    <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
      <form id="form1" method="post" runat="server">
  
         <a href="http://www.microsoft.com" runat="server"> Enter site.</a>
  
      </form>
    </body>
 
 </html>
<%@ Page Language="VB" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
   
    <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
      <form id="form1" method="post" runat="server">
  
         <a href="http://www.microsoft.com" runat="server"> Enter site.</a>
  
      </form>
    </body>
 
 </html>

설명

컨트롤을 클릭할 때 HtmlAnchor 연결할 URL을 지정하려면 이 속성을 사용합니다.

적용 대상