<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.Notification.UpdateInterval.DefaultCS" %>
<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
<title>Telerik ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
<script type="text/javascript">
function OnClientUpdated(sender, args) {
var message = "Update (check) was done!";
var newMsgs = sender.get_value();
if (newMsgs != 0) {
sender.show();
message += (newMsgs == 1) ? (" There is 1 new message!") : (" There are " + newMsgs + " new messages!");
} else {
message += " There are no new messages!";
}
logEvent(message);
}
</script>
<div class="demo-container size-medium">
<p>
The RadNotification in this demo is configured to update on every 3 seconds. The
example simulates a scenario of checking for new messages at specified interval—if
there are new messages, the notification is shown. Otherwise it does not show.
</p>
</div>
<qsf:eventlogconsole id="EventLogConsole1" runat="server" allowclear="true"></qsf:eventlogconsole>
<telerik:RadNotification RenderMode="Lightweight" id="RadNotification1" runat="server" loadcontenton="TimeInterval"
width="300" height="150" animation="Fade" enableroundedcorners="true" enableshadow="true"
onclientupdated="OnClientUpdated" title="Received messages" offsetx="-20" offsety="-20"
titleicon="none" updateinterval="3000" autoclosedelay="1500" oncallbackupdate="OnCallbackUpdate">
<ContentTemplate>
<asp:Literal ID="lbl" runat="server"></asp:Literal>
</ContentTemplate>
</telerik:radnotification>
</form>
</body>
</html>