C#
ASPX<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<asp:Timer runat="server" ID="ajaxTimer" Interval="5000" Enabled="true" OnTick="ajaxTimer_Tick"></asp:Timer>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="mainPanel" runat="server">
<asp:Label ID="lblFecha" runat="server"></asp:Label>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
Codebehindprotected void ajaxTimer_Tick(object sender, EventArgs e)
{
lblFecha.Text = DateTime.Now.ToString();
ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "afterupdate", "CallAlert();", true);
}
javascript (Main.js)function CallAlert() {
alert(new Date());
}
ASPX donde esta el scriptmanager, en mi caso está en la master<asp:ScriptReference Path="~/Scripts/Main.js" />
Listo!
Saludos