PropertyGridEditorPart 웹 서버 컨트롤 선언 구문

연결된 WebPart 또는 서버 컨트롤의 사용자 지정 속성을 최종 사용자가 편집하는 데 사용할 수 있는 편집기 컨트롤을 제공합니다. 이 클래스는 상속될 수 없습니다.

<asp:PropertyGridEditorPart
    AccessKey="string"
    BackColor="color name|#dddddd"
    BackImageUrl="uri"
    BorderColor="color name|#dddddd"
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|
                 Inset|Outset"
    BorderWidth="size"
    ChromeState="Normal|Minimized"
    ChromeType="Default|TitleAndBorder|None|TitleOnly|BorderOnly"
    CssClass="string"
    DefaultButton="string"
    Description="string"
    Direction="NotSet|LeftToRight|RightToLeft"
    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"
    GroupingText="string"
    Height="size"
    HorizontalAlign="NotSet|Left|Center|Right|Justify"
    ID="string"
    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"
    ScrollBars="None|Horizontal|Vertical|Both|Auto"
    SkinID="string"
    Style="string"
    TabIndex="integer"
    Title="string"
    ToolTip="string"
    Visible="True|False"
    Width="size"
    Wrap="True|False"
/>

설명

PropertyGridEditorPartWebPartZoneBase 영역에 배치된 서버 컨트롤과 WebPart의 사용자 지정 속성을 사용자가 편집하는 데 사용할 수 있는 일반 UI(사용자 인터페이스)를 제공합니다. 이와는 달리 AppearanceEditorPartBehaviorEditorPart 컨트롤 등의 다른 EditorPart 컨트롤은 WebPart 클래스의 기존 UI 기반 속성을 편집하는 데만 사용됩니다.

PropertyGridEditorPart 및 웹 파트 컨트롤에 대한 자세한 내용은 ASP.NET 웹 파트 컨트롤를 참조하십시오.

예제

다음 코드 예제에서는 PropertyGridEditorPart 컨트롤을 사용하는 방법을 보여 줍니다. 이 웹 페이지에는 EditorZone 컨트롤에 대한 선언적 참조와 함께 PropertyGridEditorPart 컨트롤에 대한 선언적 참조가 들어 있는 자식 zonetemplate 요소가 포함되어 있습니다.

@ Register에서 참조하는 사용자 정의 컨트롤 및 사용자 지정 컨트롤에 대한 정의를 보려면 PropertyGridEditorPart에 대한 클래스 개요에 있는 "예제"를 참조하십시오.

<%@ page language="VB" %>
<%@ register TagPrefix="uc1" 
  TagName="DisplayModeMenuVB" 
  Src="DisplayModeMenuVB.ascx" %>
<%@ register tagprefix="aspSample" 
  Namespace="Samples.AspNet.VB.Controls" 
  Assembly="UserInfoWebPartVB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

  Protected Sub Page_Load(ByVal sender As Object, _
    ByVal e As System.EventArgs)
    Button1.Visible = False
    TextBox1.Visible = False
  End Sub

  Shared editControlTitle As String

  Protected Sub Button1_Click(ByVal sender As Object, _
    ByVal e As System.EventArgs)
    editControlTitle = Server.HtmlEncode(TextBox1.Text)
    PropertyGridEditorPart1.Title = editControlTitle 
  End Sub

  Protected Sub PropertyGridEditorPart1_Init(ByVal _
    sender As Object, ByVal e As System.EventArgs)
    If Not editControlTitle Is Nothing Then
      PropertyGridEditorPart1.Title = editControlTitle
    End If
  End Sub

  Protected Sub PropertyGridEditorPart1_PreRender(ByVal _
    sender As Object, ByVal e As System.EventArgs)
    Button1.Visible = True
    TextBox1.Visible = True
  End Sub

</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head id="Head1" runat="server">
    <title>
      User Information WebPart with EditorPart
    </title>
  </head>
  <body>
    <form id="form1" runat="server">
      <asp:webpartmanager id="WebPartManager1" runat="server"  />
      <uc1:DisplayModeMenuVB ID="DisplayModeMenu1" runat="server" />
      <asp:webpartzone id="zone1" runat="server" >
        <PartTitleStyle BorderWidth="1" 
          Font-Names="Verdana, Arial"
          Font-Size="110%"
          BackColor="LightBlue" />
        <zonetemplate>
          <aspSample:UserInfoWebPart 
            runat="server"   
            id="userinfo" 
            title = "User Information WebPart"
            BackColor="Beige" />          
        </zonetemplate>
      </asp:webpartzone> 
      <div>
      <hr />
      <asp:Button ID="Button1" runat="server" 
        Text="Update EditorPart Title" 
        OnClick="Button1_Click" />
      <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
      </div>
      <asp:EditorZone ID="EditorZone1" runat="server">
        <ZoneTemplate>
          <asp:PropertyGridEditorPart ID="PropertyGridEditorPart1" 
            runat="server" 
            Title="Edit Custom Properties"
            OnPreRender="PropertyGridEditorPart1_PreRender" 
            OnInit="PropertyGridEditorPart1_Init" />   
        </ZoneTemplate>
      </asp:EditorZone>
    </form>
  </body>
</html>
<%@ page language="c#" %>
<%@ register TagPrefix="uc1" 
  TagName="DisplayModeMenuCS" 
  Src="DisplayModeMenuCS.ascx" %>
<%@ register tagprefix="aspSample" 
  Namespace="Samples.AspNet.CS.Controls" 
  Assembly="UserInfoWebPartCS" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

  protected void Page_Load(object sender, EventArgs e)
  {
    Button1.Visible = false;
    TextBox1.Visible = false;
  }

  private static String editControlTitle;

  protected void Button1_Click(object sender, EventArgs e)
  {
    editControlTitle = Server.HtmlEncode(TextBox1.Text);
    PropertyGridEditorPart1.Title = editControlTitle;
  }

  protected void PropertyGridEditorPart1_Init(object sender, EventArgs e)
  {
    if (editControlTitle != null)
      PropertyGridEditorPart1.Title = editControlTitle;
  }  

  protected void PropertyGridEditorPart1_PreRender(object sender,
    EventArgs e)
  {
    Button1.Visible = true;
    TextBox1.Visible = true;
  }

</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>
      User Information WebPart with EditorPart
    </title>
  </head>
  <body>
    <form id="form1" runat="server">
      <asp:webpartmanager id="WebPartManager1" runat="server"  />
      <uc1:DisplayModeMenuCS ID="DisplayModeMenu1" runat="server" />
      <asp:webpartzone id="zone1" runat="server" >
        <PartTitleStyle BorderWidth="1" 
          Font-Names="Verdana, Arial"
          Font-Size="110%"
          BackColor="LightBlue" />
        <zonetemplate>
          <aspSample:UserInfoWebPart 
            runat="server"   
            id="userinfo" 
            title = "User Information WebPart"
            BackColor="Beige" />          
        </zonetemplate>
      </asp:webpartzone> 
      <div>
      <hr />
      <asp:Button ID="Button1" runat="server" 
        Text="Update EditorPart Title" 
        OnClick="Button1_Click" />
      <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
      </div>
      <asp:EditorZone ID="EditorZone1" runat="server">
        <ZoneTemplate>
          <asp:PropertyGridEditorPart ID="PropertyGridEditorPart1" 
            runat="server" 
            Title="Edit Custom Properties"
            OnPreRender="PropertyGridEditorPart1_PreRender" 
            OnInit="PropertyGridEditorPart1_Init" />   
        </ZoneTemplate>
      </asp:EditorZone>
    </form>
  </body>
</html>

참고 항목

참조

PropertyGridEditorPart

기타 리소스

ASP.NET 웹 파트 컨트롤