日期:2014-05-17 浏览次数:20436 次
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" > <ContentTemplate> <asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="5000" Enabled="true"> </asp:Timer> </ContentTemplate> </asp:UpdatePanel> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <cc1:popupwin id="pw" runat="server" DragDrop="False" Height="109px" Width="175px" AutoShow="true"> </cc1:popupwin> </ContentTemplate> </asp:UpdatePanel>
protected void Timer1_Tick(object sender, EventArgs e) { DataSet ds = AccessDAL.Books_hotel.Books_Tanchu(0, 0); if (ds.Tables[0].Rows.Count > 0) { pw.Title = "通知"; pw.Message = "您好,当前您有留言信息未读。<a href=\"Books/books_list.aspx?page=31\" target=\"mainFrame\">点击进入</a>"; ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.UpdatePanel1.GetType(), "msg", "pwespopup_winLoad();", true); this.UpdatePanel1.Update(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DataSet ds = AccessDAL.Books_hotel.Books_Tanchu(0, 0); if (ds.Tables[0].Rows.Count > 0) { pw.Title = "通知"; pw.Message = "您好,当前您有留言信息未读。<a href=\"Books/books_list.aspx?page=31\" target=\"mainFrame\">点击进入</a>"; } else { pw.AutoShow = false; } } }