Persisting Programmatically Added WebParts

I

Imran

Hi,

How can I persist a webpart that is added to a page using the webpart
managers addWebPart method in asp.net 2.0. My intention is to give the
user the ability to load a predetermined collection of web parts by
selecting a preset. Thanks in advance..
 
G

Guest

Imran,
Search for the following
enterSharedScope
PersonalizationScope.Shared
Personalization.ToggleScope

You need to make changes in shared scope then any changes or webparts you
add will be starting point for all other users. If you add webpart then all
other users will have that webpart as a starting point. As far as making a
selection for the users you could make a couple different pages.

My entire Dev Web Site is made of webparts. You are welcome to register and
check out how it works as a user, click the tree in the top left to enter
edit mode. click the folder icons to put webparts into your webpart folders.
http://www.DWS400.com

Good Luck
DWS
 
I

Imran

Hi,

Thanks for the reply DWS, but I think my problem is not with the scope.
What I want is to insert a webpart programmatically once when a user
clicks something and have it persist for that particular user without
needing to add it each time the user visits the page. Something akin to
what the catalog part does now. Thanks..
 
I

Imran

Hi,

It seems we have to extend the webpart manager and call the method
SetPersonalizationdirty() to persist dynamically added webparts.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top