以编程方式将 Web 部件添加到 Sharepoint 页面并将值保存到 Web 部件个性化存储中 [英] Add web part programmatically to a Sharepoint Page and save values into the web part personalization store

查看:61
本文介绍了以编程方式将 Web 部件添加到 Sharepoint 页面并将值保存到 Web 部件个性化存储中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我以编程方式创建了一个 Web 部件页面,并使用 SPLimitedWebPartManager 向其中添加了一个 Web 部件.我还想为 Web 部件设置一些属性并将其保存到 Web 部件个性化范围中.如何访问 Web 部件的个性化存储.

In my project I programmatically create a web part page and add a web part to it using SPLimitedWebPartManager. I also want to set some properties for the web part and save it into the web part personalization scope. How can I access the personalization store for the web part.

推荐答案

在更改属性后使用 SPLimitedWebPartManager 上的 SaveChanges 方法来设置它们.

Use the method SaveChanges on SPLimitedWebPartManager after change your properties to set them.

这篇关于以编程方式将 Web 部件添加到 Sharepoint 页面并将值保存到 Web 部件个性化存储中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆