This article will show you how you can create the asp.net ajax
maskededit with validation in asp.net using c#.
Some of my previous articles are as follows: Confirmation
Message With Yes, No Button In Asp.Net Using ConfirmButtonExtender and
ModalPopupExtender, Watermark
In Asp.Net TextBox, Ajax
Call Using UpdatePanel Display Data On Button Click Without Refresh In Asp.Net,
C#, Display
ModalPopupExtender on Page Load In Asp.Net Using AjaxControlToolkit, C#.Net,
CalendarExtender
Example With Custom Style By Css Uaing Asp.net and Css, Execute
Or Open ModalPopupExtender as MessageBox From Code Behind Using C#.Net In
Asp.Net, Display
Validation in ToolTip Using ValidatorCalloutExtender in Asp.Net.
So for this article first we will create a new asp.net application and add the ScriptManager , MaskedEditExtender and a textbox control. After adding all the controls your page code will look as shown below.
So for this article first we will create a new asp.net application and add the ScriptManager , MaskedEditExtender and a textbox control. After adding all the controls your page code will look as shown below.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm13.aspx.cs" Inherits="WebApplication2.WebForm13"
%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
TagPrefix="cc1"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Asp.Net Ajax MaskedEdit With Validation In Asp.Net Using C#</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Enter Number :
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:MaskedEditExtender ID="MaskedEditExtender1" Mask="9,999,999.99"
MaskType="Number"
MessageValidatorTip="true" AcceptNegative="Left" ErrorTooltipEnabled="True" runat="server"
TargetControlID="TextBox1">
</cc1:MaskedEditExtender>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</form>
</body>
</html>
|
In above code I have assign the Mask="9,999,999.99"
and MaskType="Number" to allow
user to add only in the textbox.
0 comments:
Please let me know your view