text box validataion

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2007
Posts: 4
Reputation: samycbe is an unknown quantity at this point 
Solved Threads: 0
samycbe samycbe is offline Offline
Newbie Poster

text box validataion

 
0
  #1
Jul 23rd, 2007
how to make a validation like vb in asp.net? I want to make a text box should only accept numeric values....

samy
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 95
Reputation: manoshailu is an unknown quantity at this point 
Solved Threads: 9
manoshailu's Avatar
manoshailu manoshailu is offline Offline
Junior Poster in Training

Re: text box validataion

 
0
  #2
Jul 25th, 2007
hi,

To validate the numeric in the TextBox use


RegularExpressionValidator control
In Properties

Specify the control which control to validate in ControlToValidate Property.

In Text Property Specify any Error Message.




regards
shailu
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 3
Reputation: vinod varma is an unknown quantity at this point 
Solved Threads: 0
vinod varma vinod varma is offline Offline
Newbie Poster

Re: text box validataion

 
0
  #3
Jul 25th, 2007
Originally Posted by samycbe View Post
how to make a validation like vb in asp.net? I want to make a text box should only accept numeric values....

samy
friend may i know what language you are using
you want tovalidate that on client side or server side
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 95
Reputation: manoshailu is an unknown quantity at this point 
Solved Threads: 9
manoshailu's Avatar
manoshailu manoshailu is offline Offline
Junior Poster in Training

Re: text box validataion

 
0
  #4
Jul 25th, 2007
hi,

Its a server side validation control, this control can be used in VB or C# and one more thing u have to mainly specify the Validation Expression in the control property.

Numeric Validation : \d {3,5} -----> d -Numeric Checking, {} - Size
Character Validation : \D {5,10} -----> D - Character Validation, {} - Size.


Regards
Shailu.
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 47
Reputation: kedar_challa is an unknown quantity at this point 
Solved Threads: 1
kedar_challa's Avatar
kedar_challa kedar_challa is offline Offline
Light Poster

Re: text box validataion

 
0
  #5
Jul 25th, 2007
Hi,

I would suggest you to use "MaskedEdit" control from ajax toolkit. here is the link.

http://ajax.asp.net/ajaxtoolkit/Mask...askedEdit.aspx
Thanks,

KedarNath Challa
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 216
Reputation: jamello is an unknown quantity at this point 
Solved Threads: 6
jamello's Avatar
jamello jamello is offline Offline
Posting Whiz in Training

Re: text box validataion

 
0
  #6
Jul 27th, 2007
If the intention is only to make the textbox accept only numeric values, just very simply use the Isnumeric function.

that is
  1.  
  2. if not Isnumeric(textbox.text) then
  3. 'do stuff like forcing retyping of content
  4. end if
  5.  
Hope this helps.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 217
Reputation: mail2saion is an unknown quantity at this point 
Solved Threads: 31
mail2saion's Avatar
mail2saion mail2saion is offline Offline
Posting Whiz in Training

Re: text box validataion

 
0
  #7
Apr 10th, 2009
HI,
HOPE THE BELOW LINK WILL HELP READERS A LOT FOR CROSS-BROWSER NUMERIC VALIDATION:
http://shawpnendu.blogspot.com/2009/...isnumeric.html
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 596
Reputation: buddylee17 has a spectacular aura about buddylee17 has a spectacular aura about 
Solved Threads: 125
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Pro

Re: text box validataion

 
0
  #8
Apr 10th, 2009
mail2saion, many thanks for bumping this thread to promote your blog.
Lost time is never found again.
- Benjamin Franklin
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 4
Reputation: nil is an unknown quantity at this point 
Solved Threads: 0
nil nil is offline Offline
Newbie Poster

Re: text box validataion

 
0
  #9
Apr 12th, 2009
Originally Posted by samycbe View Post
how to make a validation like vb in asp.net? I want to make a text box should only accept numeric values....

samy
Hi,
First of all you need validation for textbox and you want user to enter only numeric values. So rather than allowing user to enter something and check it whether it is numeric or not is not good approach. I believe prevention is better than cure.

So you can Use FilterTextboxExtender that comes with AjaxToolkit. Please have a look at this demo

I hope this will solve your problem. You can use other tools also, they are very useful.

Happy Programming!!
Regards,
Nil
"If you like me raise your hand, if not raise your standard"
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC