다음을 통해 공유


WebPartDescription.Title 속성

정의

해당 WebPart 컨트롤의 제목 텍스트를 가져옵니다.

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

속성 값

해당 컨트롤의 제목을 포함하는 문자열입니다. 기본값은 .NET Framework에서 제공하는 계산 문자열입니다.

예제

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

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

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

설명

속성 값 Title 은 속성에 WebPart.DisplayTitle 직접 해당합니다. 속성에 해당하는 WebPartDisplayTitle 컨트롤이 무엇이든 속성 값 Title 이 되고, 그렇지 않으면 제목은 계산된 값입니다.

이 속성은 Title 페이지가 카탈로그 표시 모드 WebPart 이고 컨트롤 카탈로그에 컨트롤이 표시되는 경우에만 적용됩니다. 컨트롤에 WebPart 할당된 제목은 카탈로그의 컨트롤 옆에 표시됩니다.

적용 대상

추가 정보