Saturday, 27 August 2016

Ajax Mask Delimiters in asp.net


//HTML

<asp:ToolkitScriptManager ID="toolkitM" runat="server"></asp:ToolkitScriptManager>


<asp:TextBox ID="txt_code" runat="server" Width="130px" Height="22px" />
<asp:MaskedEditExtender ID="MaskedEditExtender2" runat="server"
            TargetControlID="txt_code"
             Mask="9,999,999.99"
             MessageValidatorTip="true"
             OnFocusCssClass="MaskedEditFocus"
             OnInvalidCssClass="MaskedEditError"
             MaskType="Number"
             InputDirection="RightToLeft"
             AcceptNegative="Left"
             DisplayMoney="Left"
             ErrorTooltipEnabled="True">

             </asp:MaskedEditExtender>


//Result - only numeric with decimal

<asp:TextBox ID="txt_code" runat="server" Width="130px" Height="22px" />
<asp:MaskedEditExtender ID="MaskedEditExtender2" runat="server"
            TargetControlID="txt_code"
             Mask="LL/999,999.99"
             MessageValidatorTip="true"
             OnFocusCssClass="MaskedEditFocus"
             OnInvalidCssClass="MaskedEditError"
             MaskType="Number"
             InputDirection="RightToLeft"
             AcceptNegative="Left"
             DisplayMoney="Left"
             ErrorTooltipEnabled="True">

             </asp:MaskedEditExtender>

//Result - Alpha/numeric,numeric.numeric

Mask Type-

None – No validation
Number – Number validation
Date – Date validation
Time – Time validation
DateTime – Date and time validation

1) Mask Characters and Delimiters
9 - Only a numeric character
L - Only a letter
$ - Only a letter or a space
C - Only a custom character (case sensitive)
A - Only a letter or a custom character
N - Only a numeric or custom character
? - Any character

/ - Date separator
: - Time separator
. - Decimal separator
, - Thousand separator
\ - Escape character
{ - Initial delimiter for repetition of masks
} - Final delimiter for repetition of masks

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...