as for the numers only, u can use masked text box instead of text box. then in the properties column, under the mask section, put ####. if u only allow lets say 5 digits then put #####
if u don want it blank, u can put something like this in your code
string.IsNullOr Empty(masktextb ox.Text)
as for the numers only, u can use masked text box instead of text box. then in the properties column, under the mask section, put ####. if u only allow lets say 5 digits then put #####
if u don want it blank, u can put something like this in your code
string.IsNullOr Empty(masktextb ox.Text)
thanks for your reply,
but i donot find the masked textbox in my tool box
Masked textbox is only available for Windows Forms. I'm guessing that this is ASP.NET?
When asking questions, you should always include 3 things:
Language
Platform
Framework Version
Now, the Masked textbox has been made available for use in web apps through the ASP.NET AJAX toolkit, so if you are using Framework 3.5, you might want to look into that.
Otherwise, you can validate after the postback. Just try to Parse a number, and if it fails, then you know you have invalid data.
Furthermore, you could write Javascript to validate on the client side. We have a javascript forum that could help you with that. But please do your own research first, as nobody is just going to hand you code.
Comment