Pages

Monday, June 15, 2009

Web Part error “Custom Web part properties does not show up”

Today I was struggling with custom web part properties error; it was giving me error “Custom Webpart properties do not show up”.

The error solution was that if you inherit your web part from System.Web.UI.WebControls.WebParts.WebPart then you have to insert these lines for custom web part properties

[Personalizable(PersonalizationScope.Shared), WebBrowsable(true), SPWebCategoryName("MediaServerURL"),Category("Miscellaneous")].
And when you inherit your web part from this namespace Microsoft.SharePoint.WebPartPages.WebPart then you have to insert below lines for custom web part properties


[Browsable(
false), Category("Miscellaneous"), DefaultValue(defaultAssociatedListID), WebPartStorage(Storage.Shared), FriendlyName("AssociatedListID"), Description("AssociatedListID Property")]

I hope this will help to someone.

2 comments: