Why not you are using ajax filtertextboxextender.using this control you can restrict user to enter the charters you dont want.It saves your lot of time.
This \d+ will work and it wont allow spaces before or after the digits but it wont if there are only spaces so you need RequiredFieldValidator too Regards,
frez
Contributor
5418 Points
913 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Jun 07, 2010 01:11 PM|LINK
[\d]
namratam
Member
483 Points
169 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Jun 07, 2010 01:56 PM|LINK
use regular expression and fileteredtextextender both to get the desired functionality
Software Developer
Mumbai
sspatrudu
Member
16 Points
8 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Jul 21, 2010 03:23 PM|LINK
namratam
Member
483 Points
169 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Aug 13, 2010 10:05 AM|LINK
Why not you are using ajax filtertextboxextender.using this control you can restrict user to enter the charters you dont want.It saves your lot of time.
Software Developer
Mumbai
sumanmodi
Member
2 Points
1 Post
Re: Regular Expression Validator - Numbers only no letters no spaces
Oct 25, 2010 11:57 AM|LINK
thats really helpful.
spmamidi
Participant
1157 Points
184 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Oct 25, 2010 02:07 PM|LINK
Please start a new thread if you are looking other regular expressions.
Here is the regular expression.
\b([1][012]|[1-9])\b
Shiva Mamidi
hitesh s
Participant
1278 Points
303 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Oct 25, 2010 02:13 PM|LINK
Hi Lewis,
Use this one and i think this will work fine..... In this it will allow only numbers without any spaces in it
"^([0-9])+$"
Hitesh Kumar Vyas S.
"Nobody can do everything, but everyone can do something."
vengat.net
Member
83 Points
103 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Dec 04, 2010 12:19 PM|LINK
This \d+ will work and it wont allow spaces before or after the digits but it wont if there are only spaces so you need RequiredFieldValidator too Regards,
hey thanks this one is work thank guys
Dot net Developer
SGS Technologie
matifnadeem
Contributor
4606 Points
1094 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Apr 26, 2011 06:21 AM|LINK
Hi TaffyLewis
Use filterTextbox control instead of using regular express
For example
<asp:TextBox ID="txtContact" runat="server" MaxLength="30" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtContact"
Text="*" ErrorMessage="Contact is required" ToolTip="Only supports numeric and -+()" />
<asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txtContact" ValidChars="1234567890-+()" />
<asp:ValidationSummary ID="ValidationSummary1" runat="server" />
its support only letters no alphabet or space.
M Atif Nadeem
Mark as Answer if you got right thing
Read my blog | Follow me on LinkedIn
matifnadeem
Contributor
4606 Points
1094 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
May 03, 2011 09:15 AM|LINK
Is this helpfull for you or not/
M Atif Nadeem
Mark as Answer if you got right thing
Read my blog | Follow me on LinkedIn