Add the web part programmatically to a Sharepoint page and store the values in the web part personalization store
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 store it in the web part personalization area. How can I access the personalization store for the web part.
Use the SaveChanges method in SPLimitedWebPartManager after modifying your properties to set them.
Please refer to the following post to add the web part programmatically:
http://www.etechplanet.com/post/2009/03/18/AddingRemoving-web-part-programmatically-in-SharePoint-website-using-C-Code.aspx
To change the property values of a web part programmatically, refer to the following entry:
http://www.etechplanet.com/post/2009/03/19/Modify-property-values-of-a-web-part-in-SharePoint-website-programmatically-using-C.aspx