SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to manage my WebPart Properties.

I would store an ID -> this id is the id of a configuration for my webpart.

First: How can i Store it?

Second: How can i Find it?

I'm using the renderOption(), the displayEditMode(), displayDesignMode().

share|improve this question

This article from Microsoft describes exactly how to use web part properties: http://msdn.microsoft.com/en-us/library/dd584174(v=office.11).aspx

Basically, you mark (decorate) a c# Property in your code as follow:

[Personalizable(PersonalizationScope.Shared)]
[WebBrowsable(true)]
[System.ComponentModel.Category("MyCategory")]
[WebDisplayName("Display Name")]
[WebDescription("My Description")]

public string MyProperty { set; get; }

Next up, you can access the property directly in your code:

string propertyValue = this.MyProperty;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.