<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.Notification.WAIARIASupport.DefaultCS" %>
<%@ 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>
<link href="styles.css" rel="stylesheet" type="text/css" />
</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 showNotification() {
var notification = $find("<%=RadNotification1.ClientID %>");
setTimeout(function () {
notification.show();
}, 0);
}
function CheckIfShow(sender, args) {
var summaryElem = document.getElementById("<%= ValidationSummary1.ClientID%>");
//check if summary is visible - if not, there are not errors, do not notify and continue with postback
var noErrors = summaryElem.style.display == "none";
args.set_cancel(noErrors);
}
</script>
<div class="demo-container" id="demo-container">
<div class="contentDiv">
<div class="inputWrap">
<label id="firstNameLabel" for="firstName">
First Name
</label>
<asp:TextBox ID="firstName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvFirstName" runat="server" ControlToValidate="firstName"
Text="*" ErrorMessage="Please, fill in your first name!">
</asp:RequiredFieldValidator>
</div>
<div class="inputWrap">
<label for="lastName">
Last Name
</label>
<asp:TextBox ID="lastName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvLastName" runat="server" ControlToValidate="lastName"
Text="*" ErrorMessage="Please, fill in your last name!">
</asp:RequiredFieldValidator>
</div>
<div class="inputWrap">
<label for="address">
Address
</label>
<asp:TextBox ID="address" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvAddress" runat="server" ControlToValidate="address"
Text="*" ErrorMessage="Please, fill in your address!">
</asp:RequiredFieldValidator>
</div>
<div class="inputWrap submitRow">
<asp:Button ID="btnSubmit" runat="server" OnClientClick="showNotification();" Text="Submit">
</asp:Button>
</div>
</div>
</div>
<telerik:RadNotification RenderMode="Lightweight" ID="RadNotification1" runat="server" Width="300" Animation="Fade"
OnClientShowing="CheckIfShow" EnableRoundedCorners="true" EnableShadow="true"
LoadContentOn="PageLoad" Title="Validation errors" OffsetX="-20" OffsetY="-20"
TitleIcon="warning" EnableAriaSupport="true" ShowSound="warning" AutoCloseDelay="7000">
<ContentTemplate>
<asp:ValidationSummary ID="ValidationSummary1" runat="server"></asp:ValidationSummary>
</ContentTemplate>
</telerik:RadNotification>
<telerik:RadFormDecorator RenderMode="Lightweight" ID="RadFormDecorator1" runat="server" DecoratedControls="All" DecorationZoneID="demo-container" />
</form>
</body>
</html>