Store on user data in sharepoint webpart

I need to save some user data (string) in my Sharepoint web part. I think the hidden properties of a webpage should do the trick. Tried with the following webpart property attributes:

[WebBrowsable(false)]
[Bindable(true)]
[WebPartStorage(Storage.Personal)]
[Personalizable(PersonalizationScope.User)]

But I observe in the web part that the data stored is not user-specific. Any help?

+3
source share
1 answer

How do you read your data? You can use the WebPart.PartCacheRead method to retrieve usage values.

web.config can be modified to tell how you want to save WebPart.EffectiveStorage can also help determine how the data is stored:

if (EffectiveStorage == Storage.Shared)
{
    output.Write("<b>You are now in shared mode.</b>");
}

, WebBrowsable false. -? ?

+2

Source: https://habr.com/ru/post/1729213/


All Articles