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 want to allow a user to store personal information in my WebPart.

So I have a property:

 [Pages.SPWebCategoryName("Tag to display")]
 [WebDescription("You would put the description here.")]
 public string Tag { get; set; }

The customer wants to update the Tag property in the SharePoint WebPart directly on "OK" button click!

protected void OnButtonClick(...)
    var text = tb.Text;
    this.WebPart.Tag = text;
    // How to store?

How do I save the information for a specific user?

share|improve this question
up vote 1 down vote accepted

Try the following in your click event:

  • Get the limitedwebpartmanager for the current page, in whichever scope you wish
  • ask that webpartmanager for the webpart with the id == this.ID (aka, this webpart)
  • edit the property
  • webpartmanager.savechanges(webpart);

You'll need to refresh the page but I believe that should work to set the property for the web part.

share|improve this answer
Sound like a plan. I will try this one. – Evgeny Dec 3 '12 at 19:53

This is bad solution because each user should check in page on self after each update.

So its better to store data somewhere else.

share|improve this answer

Your Answer


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.