I have a user control which acts as a footer for my website and uses java script jqdock.js to show apple type bottom menu. I added an update panel to the usercontrol. What problem I am having now is, it works fine initally but once I click the mail button which is in the usercontrol , the whole user control dissapears, after postback i guess. below is the usercontrol and code view:
enter code here
public void Page_Load(object sender, EventArgs e)
{
// Page.ClientScript.RegisterClientScriptInclude("bottomMenu", "../js/jqDock.js");
ScriptManager.RegisterClientScriptInclude(this,this.GetType(),"bottomMenu", "../js/jqDock.js");
//ScriptManager.RegisterStartupScript(this, this.GetType(), "bottomMenu", "../js/jqDock.js",true);
}
//design view
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucBottomMenu.ascx.cs"
Inherits="uc_ucBottomMenu" %>
<div id="dockWrapper" style="position: fixed; background: url('user/use.png');
padding: 10px; margin: 0 auto; width: 700px; height: 100px;" class="noprint">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="dock">
<asp:PlaceHolder ID="phEmail" runat="server"><a id="hplEmail" runat="server">
<src="/dock/email.png" title="Email" alt="Email" /></a> </asp:PlaceHolder>
</asp:PlaceHolder>
</div>
</ContentTemplate>
</asp:UpdatePanel>
You need to register a startup script in your codebehind to call a function to re-initialize your jqDock. This is becuase after the UpdatePanel postback, everything inside of
<ContentTemplate></ContentTemplate>gets replaced.Code-Behind:
Script: