다음을 통해 공유


WebPartDescription.Description 속성

정의

컨트롤에 대한 WebPart 설명의 텍스트를 가져옵니다.

public:
 property System::String ^ Description { System::String ^ get(); };
public string Description { get; }
member this.Description : string
Public ReadOnly Property Description As String

속성 값

컨트롤에 대한 WebPart 설명을 포함하는 문자열입니다. 기본값은 빈 문자열("")입니다.

예제

다음 코드 예제에서는 속성의 프로그래밍 방식으로 사용 하는 방법을 보여 줍니다 Description . 이 코드 예제를 실행하는 데 필요한 전체 코드는 클래스 개요 항목의 예제 섹션을 WebPartDescription 참조하세요.

웹 페이지의 메서드에 있는 Button1_Click 다음 코드는 메서드를 사용하여 GetAvailableWebPartDescriptions 카탈로그의 WebPartDescription 개체 컬렉션을 가져와서 개체를 반복하여 WebPartDescription 카탈로그에 있는 각 WebPart 컨트롤의 세부 정보를 표시하는 방법을 보여 줍니다. Description 속성 값은 다음 코드에서 검색됩니다.

protected void Button1_Click(object sender, EventArgs e)
{
  Label1.Text = String.Empty;
  
  WebPartDescriptionCollection descriptions = 
    DeclarativeCatalogPart1.GetAvailableWebPartDescriptions();

  foreach (WebPartDescription desc in descriptions)
  {
    Label1.Text += "ID: " + desc.ID + "<br />" +
      "Title: " + desc.Title + "<br />" +
      "Description: " + desc.Description + "<br />" +
      "ImageUrl: " + desc.CatalogIconImageUrl + "<br />" +
      "<hr />";
  }
}
Protected Sub Button1_Click(ByVal sender As Object, _
  ByVal e As System.EventArgs)
  
  Label1.Text = String.Empty
      
  Dim descriptions As WebPartDescriptionCollection = _
   DeclarativeCatalogPart1.GetAvailableWebPartDescriptions()
          
  Dim desc As WebPartDescription
      
  For Each desc In descriptions
    Label1.Text += "ID: " & desc.ID & "<br />" & _
      "Title: " & desc.Title & "<br />" & _
      "Description: " & desc.Description & "<br />" & _
      "ImageUrl: " & desc.CatalogIconImageUrl & "<br />" & _
      "<hr />"
  Next
  
End Sub

설명

속성은 Description 속성에 Part.Description 직접 해당합니다. 해당 속성이 컨트롤에 WebPart 설정된 경우 해당 WebPartDescription 개체의 속성에도 값이 있습니다.

이 속성은 Description 페이지가 카탈로그 표시 모드 WebPart 이고 컨트롤 카탈로그에 컨트롤이 표시되는 경우에만 적용됩니다. 컨트롤에 할당된 설명이 있으면 설명이 카탈로그에 컨트롤의 도구 설명으로 표시됩니다.

적용 대상

추가 정보