Geeks With Blogs
Pseudo Knowledge Base Useful stuff I've collected... Enjoy.

I have recently been working on some web parts for a site hosted on a SharePoint 2007 (aka MOSS 2007).  I was unable to get the custom properties to work.  Paul Stork was kind enough to provide the answer.  Apparently the method declaration changed between SharePoint 2003 and 2007.  The reference that I had found was for the older version.

Old Version (2003)

private const string defaultText = "John";

private string text = defaultText;






Description("Text Property")]

public string Text


    get { return text; }

    set { text = value; }


MOSS 2007 custom Properties

,System.Web.UI.WebControls.WebParts.WebDisplayName("Text Prop Name")
,System.Web.UI.WebControls.WebParts.WebDescription("Text Prop Tooltip")
,System.Web.UI.WebControls.WebParts.Personalizable(  System.Web.UI.WebControls.WebParts.PersonalizationScope.User)
,System.ComponentModel.Category("Todd Parts")
, System.ComponentModel.DefaultValue(DEFAULT_TEXT_PROP)]
public string TextProp
  get { return _textProp; }
  set { _textProp = value; }

Posted on Monday, November 3, 2008 10:46 PM SharePoint | Back to top

Comments on this post: SharePoint 2007 Custom Properties

# re: SharePoint 2007 Custom Properties
Requesting Gravatar...
Thank you so much man for this post !! I don't believe I have been searching like crazy and I couldn't find anything to solve my problem. I thought there was something wrong in the code itself .. but thanks you just made my day !!
Left by Mohammad Ghassan on Jun 08, 2009 1:23 AM

Your comment:
 (will show your gravatar)

Copyright © Geordie | Powered by: | Join free