读书人

SharePoint2010 Visual Web Part 自定

发布时间: 2012-03-20 14:01:10 作者: rapoo

SharePoint2010 Visual Web Part 自定义属性问题
SharePoint2010 Visual Web Part 的自定义属性用2007的方法无法在WebPart的属性编辑窗体中显示,不知道谁有没有好的解决方法。

O(∩_∩)O谢谢

[解决办法]
[System.Web.UI.WebControls.WebParts.WebBrowsable(true),
System.Web.UI.WebControls.WebParts.WebDisplayName("Custom Prop"),
System.Web.UI.WebControls.WebParts.WebDescription(""),
System.Web.UI.WebControls.WebParts.Personalizable(
System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared),
System.ComponentModel.Category("Settings"),
System.ComponentModel.DefaultValue("")
]
public string CustomProp
{
get { return customProp; }
set { customProp = value; }
}
这样写 试下
[解决办法]
和2007差不多吧,我曾经在beta 版上把FCK给做到webpart和field上了,方法用的就是07的,就是2010自带了类似FCK的工具,害我白忙了半天

读书人网 >行业软件

热点推荐