IListWebPart 接口
实现此接口,以创建 Web 部件类需要在窗体上放置的功能。例如, ListFormWebPart和ListViewWebPart类都实现此接口,以便他们可以位于窗体上的不同区域。
命名空间: Microsoft.SharePoint.WebPartPages
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public Interface IListWebPart
用法
Dim instance As IListWebPart
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public interface IListWebPart
备注
若要个性化 Web 部件属性的IListWebPart接口实现中,使用PersonalizableAttribute属性。这样可以确保保存并收集属性。共享的范围以允许保存的方式,它使所有用户共享属性值的属性。用户作用域允许用户保存自己单个此属性的值。例如, IListWebPart的实现,在将以下属性添加到任何IListWebPart属性,以确保该属性保存为查看 web 部件的所有用户:
[System.Web.UI.WebControls.WebParts.Personalizable(PersonalizationScope.Shared)]
使用WebBrowsableAttribute属性可指定在 Web 浏览属性编辑器 Web 部件中显示的IListWebPart属性。例如, IListWebPart的实现,在将以下属性添加到任何IListWebPart属性,以确保属性可从 Web 浏览属性编辑器 Web 部件进行了更改:
[System.Web.UI.WebControls.WebParts.WebBrowsable(true)]