for the textbox if i want to allow only numbers.what ever
the characters u enter it should not take.which event u used?

Answer Posted / chandra sekhar

@kinjal what is the use of using compare validator here??
and with what yopu are comparing the value?? your answer is
absolutely wrong.

If we want to allow only integers into a textbox then use
"^\d{0,9}" expression.

ex: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator
ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox1"
ErrorMessage="RegularExpressionValidator"
ValidationExpression="^\d{0,9}"></asp:RegularExpressionValidator>

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is "microsoft intermediate language" (msil)?

536


Is .net capable of supporting multi-thread?

592


Explain about .net assemblies?

625


Describe the programming model of a windows service

558


Explain the different types of proxy patterns?

695






How do we access crystal reports in .net?

602


which method do you use to redirect the user to another page without performing a round trip to the client? How?

490


How inheritance works in .net?

572


Explain what relationship is between a process, application domain, and application?

631


Tell us what is the native image generator?

586


what is machine key error in .NET how can we solve it?

2115


Can a try block have more than one catch block?

621


What is singlecall activation mode used for in .net?

580


What is your observations between vb.net and vc#.net?

556


What is a variable of implicit type and what is its scope?

522