in asp.net in textbox field want to type only numbers not characters
please help me.please send code.
Thanks,
Narasiman P
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nattudurai EswaramurthyPosted Jun 20, 2012, 3:25 AM
and set the property as ValidationExpression="^[0-9]*$"
Satyapriya NayakPosted Jun 20, 2012, 2:39 AM
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Number_Chracter_validation._Default" %>
Thanks
Jignesh TrivediPosted Jun 20, 2012, 2:32 AM
if you want to validate only numeric value then you can use RegularExpressionValidator control to validate the text box.
ControlToValidate="txtNo"
ValidationExpression="^[0-9]*$">
Also refer
http://msdn.microsoft.com/en-us/library/eahwtc9e.aspx
Hope this will help you.
Posted Jun 20, 2012, 2:29 AM
Santhosh Kumar JayaramanPosted Jun 20, 2012, 1:57 AM