VS 2008, vb.net .net 3.5 sp1.
I have a simple masterpage that formats the basic website. A scriptmanager, a timer a updatepanel and one content panel.
I also have a form that is a web content form based off the masterpage.
In the content I have a updatepanel that contains a number of components.
Here is the issue, whenever the timer trigger fires for the masterpage it is also causing an update which fires the Pageload() on the content page which has undesirable affects. How can I force the content page updatepanel to not fire the callback on the content page yet still update the masterpage?
Masterpage Scriptmanager properties
Masterpage updatepanel properties.Code:<asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="120" AllowCustomErrorsRedirect="False"> </asp:ScriptManager>
the updatepanel is in the footer Div of the masterpage which contains the timer, a textbox and on the page load I do the followingCode:<div id="footer"> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <table class="style2"> <tr> <td class="style3"> <asp:Label ID="lblTime" runat="server" CssClass="footertext"></asp:Label> <asp:Timer ID="Timer1" runat="server"> </asp:Timer> </td> <td align="center"> <asp:Label ID="lblmanagedby" runat="server" CssClass="footertext" Width="368px"></asp:Label> </td> </tr> </table> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /> </Triggers> </asp:UpdatePanel>
Content form Updatepanel configCode:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load lblTime.Text = thetime() Dim uid As String = HttpContext.Current.User.Identity.Name Dim managedtxt As StringBuilder managedtxt = New StringBuilder("Site managed by Citrix managed Services") managedtxt.Append(ControlChars.NewLine) managedtxt.Append("Welcome: ") managedtxt.Append(uid) managedtxt.Append(ControlChars.NewLine) managedtxt.Append("mailto:[email protected]") lblmanagedby.Text = managedtxt.ToString End Sub Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick lblTime.Text = thetime() End Sub Protected Function thetime() As String Dim currenttime As Date = Date.Now Dim stringtime As String = currenttime.ToString("g") Return stringtime End Function
Code:<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> ..... lot's o UI components </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnEdit" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="btnNew" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="btnCancel" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="btnServers" EventName="Click" /> </Triggers> </asp:UpdatePanel>




Reply With Quote