could anybody help me with this piece of code? I'm trying to update an usercontrol in the master page after the page is unloaded. Something wrong in my code?
Thanks.
PageMaster.ascx
---------------
<uc1:UserDisplay ID="UserDisplay1" runat="server" UpdateMode="Conditional" />
protected void Page_Load( object sender, EventArgs e )
{
if (!IsPostBack)
{
this.Unload += new System.EventHandler(this.Page_Unload);
}
}
PageMaster.cs
-------------
protected void Page_Unload(object sender, EventArgs e)
{
this.UserDisplay1.Update();
}
UserDisplay.ascx
----------------
<asp:UpdatePanel ID="UpdatePanelUserDisplay" runat="server"> <ContentTemplate> <asp:Panel runat="server" ID="pan_content"> <asp:Panel ID="pn_user" runat="server"> <asp:PlaceHolder ID="ph_user" runat="server" /> </asp:Panel> </asp:Panel> </ContentTemplate> </asp:UpdatePanel>
UserDisplay.cs
--------------
public UpdatePanelUpdateMode UpdateMode
{
get { return this.UpdatePanelUserDisplay.UpdateMode; }
set { this.UpdatePanelUserDisplay.UpdateMode = value; }
}
public void Update()
{
this.UpdatePanelUserDisplay.Update();
}

New Topic/Question
Reply


MultiQuote


|