Sharepoint 自定义 Web 部件属性未显示在工具箱中
我定义了一个布尔属性,如下所示:
[Browsable(true), Category("Display"), DefaultValue(false),
WebPartStorage(Storage.Shared), FriendlyName("Obey Workflow"),
Description("")]
public bool ObeyWorkflow { get; set; }
我希望它在 Web 部件的属性工具箱中呈现为复选框,但它没有显示。 我的 Web 部件派生自 Sharepoint WebPart 基类。
I have defined a boolean property as follows:
[Browsable(true), Category("Display"), DefaultValue(false),
WebPartStorage(Storage.Shared), FriendlyName("Obey Workflow"),
Description("")]
public bool ObeyWorkflow { get; set; }
I'm expecting it to render as a checkbox in the webpart's properties toolbox, however it doesn't show up. My web part is derived from the Sharepoint WebPart base class.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你走在正确的轨道上。 您只需要使用不同的属性即可。
You are on the right track. You just need to use different attributes.
@Jason,你是对的。 语法“Browsable”和“Category”是Sharepoint 2003 特定的。 对于 SharePoint 2007,它分别是“WebBrowsable”和“SPWebCategoryName”。
DefaultValue(false) 也是 SharePoint 2003 特定的。
据我所知,2007 年的情况是预先声明它,如下所示:
@Jason, you're correct. The syntax "Browsable", and "Category" are Sharepoint 2003 specific. For SharePoint 2007, it's "WebBrowsable", and "SPWebCategoryName" respectively.
DefaultValue(false) is also SharePoint 2003 specific.
The equivalent in 2007, as far as I know, is to declare it initially beforehand, like this:
我认为它是
WebBrowsable(true)
而不是Browsable(true)
i think its
WebBrowsable(true)
instead ofBrowsable(true)