Menu.Target 속성

정의

메뉴 항목과 연결된 웹 페이지 콘텐츠를 표시할 대상 창이나 프레임을 가져오거나 설정합니다.

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

속성 값

String

연결된 웹 페이지 콘텐츠를 표시할 대상 창이나 프레임입니다. 기본값은 빈 문자열("")이며 이 경우 포커스가 있는 창이나 프레임이 새로 고쳐집니다.

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 Target 해당 메뉴 항목을 마우스 오른쪽 단추로 클릭할 때 새 창에서 각 메뉴 항목에 링크 되는 콘텐츠를 지정 하는 속성을 표시 해야 합니다.


<%@ Page Language="C#" %>

<!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>Menu Target Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu Target Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">

        <items>
          <asp:menuitem navigateurl="Home.aspx" 
            text="Home"
            tooltip="Home">
            <asp:menuitem navigateurl="Music.aspx"
              text="Music"
              tooltip="Music">
              <asp:menuitem navigateurl="Classical.aspx" 
                text="Classical"
                tooltip="Classical"/>
              <asp:menuitem navigateurl="Rock.aspx"
                text="Rock"
                tooltip="Rock"/>
              <asp:menuitem navigateurl="Jazz.aspx"
                text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem navigateurl="Movies.aspx"
              text="Movies"
              tooltip="Movies">
              <asp:menuitem navigateurl="Action.aspx"
                text="Action"
                tooltip="Action"/>
              <asp:menuitem navigateurl="Drama.aspx"
                text="Drama"
                tooltip="Drama"/>
              <asp:menuitem navigateurl="Musical.aspx"
                text="Musical"
                tooltip="Musical"/>
            </asp:menuitem>
          </asp:menuitem>
        </items>
      
      </asp:menu>

    </form>
  </body>
</html>

<%@ Page Language="VB" %>

<!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>Menu Target Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu Target Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">

        <items>
          <asp:menuitem navigateurl="Home.aspx" 
            text="Home"
            tooltip="Home">
            <asp:menuitem navigateurl="Music.aspx"
              text="Music"
              tooltip="Music">
              <asp:menuitem navigateurl="Classical.aspx" 
                text="Classical"
                tooltip="Classical"/>
              <asp:menuitem navigateurl="Rock.aspx"
                text="Rock"
                tooltip="Rock"/>
              <asp:menuitem navigateurl="Jazz.aspx"
                text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem navigateurl="Movies.aspx"
              text="Movies"
              tooltip="Movies">
              <asp:menuitem navigateurl="Action.aspx"
                text="Action"
                tooltip="Action"/>
              <asp:menuitem navigateurl="Drama.aspx"
                text="Drama"
                tooltip="Drama"/>
              <asp:menuitem navigateurl="Musical.aspx"
                text="Musical"
                tooltip="Musical"/>
            </asp:menuitem>
          </asp:menuitem>
        </items>
      
      </asp:menu>

    </form>
  </body>
</html>

설명

사용 된 Target 속성 창이 나 프레임을 표시할 웹 콘텐츠를 지정 하는 메뉴 항목을 클릭할 때 메뉴 항목에 연결 합니다. 이 값은 다음 표에서처럼 밑줄로 시작하는 특수한 값을 제외하고는 대/소문자 구분 없는 A-Z 범위의 문자로 시작해야 합니다.

대상 값 Description
_blank 콘텐츠를 프레임이 없는 새 창에 렌더링합니다.
_parent 콘텐츠를 직접 실행 프레임셋 부모에 렌더링합니다.
_search 콘텐츠를 검색 창에 렌더링합니다.
_self 콘텐츠를 포커스가 있는 프레임에 렌더링합니다.
_top 콘텐츠를 프레임이 없는 전체 창에 렌더링합니다.

참고

_search 값이 지원되는지 여부를 확인하려면 브라우저 설명서를 참조하십시오. 예를 들어, Internet Explorer 버전 5.0 이상을 지원 합니다 _search 대상 값

이 속성의 모든 메뉴 항목에 적용 되는 Menu 제어 합니다. 설정 하 여이 속성을 선택적으로 재정의할 수는 Target 의 각 속성 MenuItem 직접 개체입니다.

참고

Target 속성 대상 특성으로 렌더링 합니다. 앵커 요소의 대상 특성의 XHTML 1.1 엄격한 문서 형식 정의 허용 되지 않습니다. XHTML 또는 접근성 표준을 따르도록 렌더링 된 출력을 설정 하지 마십시오는 Target 속성입니다. 자세한 내용은 참조 하세요. XHTML 표준 Visual Studio 및 ASP.NET 하 고 Visual Studio 및 ASP.NET의 내게 필요한 옵션합니다.

적용 대상

추가 정보