Regular expression validation for pan card number in asp.net

 In this article, we have written a code for Indian Pan Card validation. Many times we want to validate the pancard number in registration form. So we just need to write this ValidationExpression="[A-Z]{5}\d{4}[A-Z]{1}" . In our regular expression validation in asp.net.


Validation Expression:-

ValidationExpression="[A-Z]{5}\d{4}[A-Z]{1}"


For example:
In PAN Card format is

ABCDE1234F( 5alphabet 4digit 1alphabet)

CJSPS4983B
DSPSA8525A


Source Code:-


<asp:TextBox ID="txtname" runat="server"></asp:TextBox>

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1"
                    Display="Dynamic" ForeColor="Red" ErrorMessage="Please Enter Correct PAN Card Number" ValidationExpression="[A-Z]{5}\d{4}[A-Z]{1}"></asp:RegularExpressionValidator>



For post:-

Validation expression for Indian mobile phone number in asp.net c# , how to highlight control on validation error using java script in asp.net c#,Validating Image / File size on FileUpload before uploading file/ image using Java script

Regular expression validation for pan card number in asp.net Regular expression validation for pan card number in asp.net Reviewed by NEERAJ SRIVASTAVA on 7:47:00 PM Rating: 5

No comments:

Powered by Blogger.