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 are the differences between com architecture and.net architecture?

561


Explain something about WebService?

679


What are the namespace available in .net?

592


Whate are resource files?

612


Tell us what is heap and what is stack?

567






What does jit compilation do in .net?

580


i m fresher,hav SQL knowledge but in my ofc. i hav to work on dotnet. so plz tell me how to learn it,? from where to stat? i hav C prog. knowledge, ASP.net

2136


What is close method? How its different from finalize and dispose?

529


What are the new thee features of com+ services, which are not there in com (mts)?

520


How does u handle this COM components developed in other programming languages in .NET?

1673


Difference between class and interface in .net?

591


Why did they call it .net?

590


Explain about the features and elements present in Visual studio.NET IDE?

623


Explain what is the difference between encrypting a password and applying a hashing?

559


Explain what is the difference between response.redirect & server.transfer?

552