开发者

Store per user data in sharepoint webpart

开发者 https://www.devze.com 2022-12-18 01:16 出处:网络
I got to store some user specific data (string) in my Sharepoint webpart.I guess hidden webpart p开发者_JS百科roperties should do the trick. Tried with the following attributes on webpart property:

I got to store some user specific data (string) in my Sharepoint webpart.I guess hidden webpart p开发者_JS百科roperties should do the trick. Tried with the following attributes on webpart property:

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

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


How are you reading your data ? You can use the WebPart.PartCacheRead method to retrieve per use values.

web.config can be modified to signal how you want your WebPartCache to be stored. To support caching in database then you must include the [Serializable()] attribute to you custom classes

The WebPart.EffectiveStorage property can also help in determining how the data is stored:

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

Just wondering why you have WebBrowsable attribute set as false. Are the users not able to configure the web part ? When and how is the property value set ?

0

精彩评论

暂无评论...
验证码 换一张
取 消