SharePoint web part store with multiple web part instances on one page

I have a custom web part that I created and am trying to host three instances on the same page. I noticed that when I have one instance per page, the custom properties persist and work as expected. When I add two more instances of the same custom web part to the page, the following web parts do not retain their custom property values. I suppose I must be doing something wrong when it comes to the WebPartStorage attribute. Any thoughts?

[Browsable(true), Category("Miscellaneous"),
WebPartStorage(Storage.Personal), 
FriendlyName("List"), Description("List")]
public String List { get; set; }

      

+2


source to share


2 answers


Interestingly, I ended up removing the default and description attributes and my script started working. Not a very helpful explanation, I know, but maybe it will help someone else in the future.



0


source


Have you tried Storage.Shared and not Storage.Personal?

This will help isolate the personalization store as the cause of the problem.



Also, try removing the FriendlyName and Description attributes.

+1


source







All Articles