How to clear the WebPartManager?

G

Guest

Hello,
I want to control my WebParts programmatically. I have it set up so I can
load my WebParts from code. The user can move them around. But I want to
clear what they have done the next time they come to the page and start
fresh. How can I look at what data the WebPartManager loads? And clear it
so it can start fresh?

Thanks,
Michael

Some code:

page:
<asp:WebPartManager ID="WebPartManager1" runat="server" />
<asp:WebPartZone ID="LeftWebPartZone" runat="server">
<ZoneTemplate>
<asp:placeHolder ID="WebPart1" runat="server">
</asp:placeHolder>
</ZoneTemplate>
</asp:WebPartZone>

<asp:WebPartZOne ID="RightWebPartZone" runat="server">
<ZoneTemplate>
<asp:placeHolder ID="WebPart2" runat="server">
</asp:placeHolder>
</ZoneTemplate>
</asp:WebPartZOne>

code behind:
control = "Webparts//Calendar.ascx";
WebPart1.Controls.Add(LoadControl(control));

control = "Webparts//YahooNews.ascx";
WebPart2.Controls.Add(LoadControl(control));
 

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

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top