WebBrowsableAttribute クラス
アセンブリ: System.Web (system.web.dll 内)
構文
<AttributeUsageAttribute(AttributeTargets.Property)> _ Public NotInheritable Class WebBrowsableAttribute Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Property)] public sealed class WebBrowsableAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Property)] public ref class WebBrowsableAttribute sealed : public Attribute
PropertyGridEditorPart コントロールは、ユーザーが、WebPart のカスタム プロパティや WebPartZoneBase ゾーンに配置されるサーバー コントロールのカスタム プロパティを編集できるようにする汎用のユーザー インターフェイス (UI: User Interface) を提供します。この編集 UI は、ソース コード中で WebBrowsableAttribute クラスの WebBrowsable 属性でマークされるプロパティ用に用意されています。プロパティがこの属性によってマークされると、PropertyGridEditorPart コントロールは、プロパティの型に基づいて編集 UI を作成し、必要に応じて PropertyDescriptor オブジェクトを使用して、各編集コントロール内の値をプロパティの型に変換します。
Web パーツ コントロールのプロパティを PropertyGridEditorPart コントロールに表示できるようにマークする WebBrowsableAttribute 属性を使用する方法を、次のコード例に示します。この例は PropertyGridEditorPart クラスの概要で取り上げているコード例の一部です。
<Personalizable(), WebBrowsable(), WebDisplayName("Job Type"), _ WebDescription("Select the category that corresponds to your job.")> _ Public Property UserJobType() As JobTypeName Get Dim o As Object = ViewState("UserJobType") If Not (o Is Nothing) Then Return CType(o, JobTypeName) Else Return _userJobType End If End Get Set(ByVal value As JobTypeName) _userJobType = CType(value, JobTypeName) End Set End Property
[Personalizable(), WebBrowsable(), WebDisplayName("Job Type"), WebDescription("Select the category that corresponds to your job.")] public JobTypeName UserJobType { get { object o = ViewState["UserJobType"]; if (o != null) return (JobTypeName)o; else return _userJobType; } set { _userJobType = (JobTypeName)value; } }
System.Attribute
System.Web.UI.WebControls.WebParts.WebBrowsableAttribute
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- WebBrowsableAttribute クラスのページへのリンク