0 Replies - 8337 Views - Last Post: 18 September 2012 - 07:38 AM

#1 devaspuk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-September 12

UpdatePanel doesn't update

Posted 18 September 2012 - 07:38 AM

Hello,

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();
}



Is This A Good Question/Topic? 0
  • +

Page 1 of 1