Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Writing a custom webpart property programmatically

  Asked By: Sampat Bellubbli         Date: May 12, 2010      Category: Sharepoint      Views: 974
 

Hello

in my webpart I do have this custom property:

[Personalizable(PersonalizationScope.Shared)]
[WebPartStorage(Storage.Shared)]
[WebBrowsable(true)]
public string Names
{
get { return (this.MyNames); }
set { this.MyNames = value; }
}

This property does not appear in the edit pane and that is wanted.
My question is how can I write values into this custom property
programmatically?

Example where I want to store "Bob" into SharePoint so that the
property "Names" will always have the value "Bob":

this.Names = "Bob";

But this does not work. What am I doing wrong?


Do you know someone who can help? Share a link to this thread on twitter, or facebook.


 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Writing a custom webpart property programmatically Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].