jNotify : Disply animated boxes (informations, errors, success) in just one line of code
jNotify can display information boxes in just one line of code in asp.net .
Three kind of boxes are allowed : information, success and failure.
The whole box is entirely skinnable with css. For example, you could use it for a mail being successfully sent or a validation error of a form , or alert message .
First download JNotify from GitHub
Implementations
Add links to master page , copy images into your folder
<link href="Styles/jNotify.jquery.css" rel="stylesheet" type="text/css" />
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="Scripts/jNotify.jquery.min.js" type="text/javascript"></script>
Master page look like this
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title></title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<link href="Styles/jNotify.jquery.css" rel="stylesheet" type="text/css" />
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="Scripts/jNotify.jquery.min.js" type="text/javascript"></script>
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form runat="server">
<asp:ScriptManager ID="scmproxy" runat="server" ></asp:ScriptManager>
<div class="page">
<div class="header">
<div class="title">
<h1>
My ASP.NET Application
</h1>
</div>
<div class="clear">
</div>
</div>
<div class="footer">
</div>
</form>
</body>
</html>
Defalut.aspx Page
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script type="text/javascript">
function callalert()
{
jNotify('Here the message !!<br />You can write HTML code <strong>bold</strong>, <i>italic</i>, <u>underline</u>',
{
autoHide: true, // added in v2.0
clickOverlay: false, // added in v2.0
MinWidth: 250,
TimeShown: 3000,
ShowTimeEffect: 200,
HideTimeEffect: 200,
LongTrip: 20,
HorizontalPosition: 'center',
VerticalPosition: 'top',
ShowOverlay: true,
ColorOverlay: '#000',
OpacityOverlay: 0.3,
onClosed: function () { // added in v2.0
},
onCompleted: function () { // added in v2.0
}
}
);}
</script>
<script src="Scripts/Default.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<asp:UpdatePanel runat="server" ID="uproot" >
<ContentTemplate>
<h2>
Welcome to ASP.NET!
</h2>
<p>
To learn more about ASP.NET visit JNotify plug-in
<p>
<asp:Button runat="server" OnClientClick="callJsucces();" Text="Success" ID="btnSuccess" />
<asp:Button runat="server" OnClientClick="callJError();" Text="alert" ID="btnalert" />
<asp:Button runat="server" OnClientClick="callNotify();" Text="fail" ID="btnfail" />
</p>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
Defaulr.js File :
function callNotify() {
jNotify('Here the Notify message !!<br />You can write HTML code <strong>bold</strong>, <i>italic</i>, <u>underline</u>',
{
autoHide: true, // added in v2.0
clickOverlay: false, // added in v2.0
MinWidth: 250,
TimeShown: 3000,
ShowTimeEffect: 200,
HideTimeEffect: 200,
LongTrip: 20,
HorizontalPosition: 'center',
VerticalPosition: 'top',
ShowOverlay: true,
ColorOverlay: '#000',
OpacityOverlay: 0.3,
onClosed: function () { // added in v2.0
},
onCompleted: function () { // added in v2.0
}
}
);
}
function callJError() {
jError('Here the Error message !!<br />You can write HTML code <strong>bold</strong>, <i>italic</i>, <u>underline</u>',
{
autoHide: true, // added in v2.0
clickOverlay: false, // added in v2.0
MinWidth: 250,
TimeShown: 3000,
ShowTimeEffect: 200,
HideTimeEffect: 200,
LongTrip: 20,
HorizontalPosition: 'center',
VerticalPosition: 'top',
ShowOverlay: true,
ColorOverlay: '#000',
OpacityOverlay: 0.3,
onClosed: function () { // added in v2.0
},
onCompleted: function () { // added in v2.0
}
}
);
}
function callJsucces() {
jSuccess('Here the Success message !!<br />You can write HTML code <strong>bold</strong>, <i>italic</i>, <u>underline</u>',
{
autoHide: true, // added in v2.0
clickOverlay: false, // added in v2.0
MinWidth: 250,
TimeShown: 3000,
ShowTimeEffect: 200,
HideTimeEffect: 200,
LongTrip: 20,
HorizontalPosition: 'center',
VerticalPosition: 'top',
ShowOverlay: true,
ColorOverlay: '#000',
OpacityOverlay: 0.3,
onClosed: function () { // added in v2.0
},
onCompleted: function () { // added in v2.0
}
}
);
}
Output :
Comments
Post a Comment