.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Want to implement valdiation that phone number entered should be minimum 10 digits

Posted By:      Posted Date: October 24, 2010    Points: 0   Category :ASP.Net

I have text box where user enter phone number and I have to implement that logic that phone number entered should be of minumum 10 digits.Otherwise it shows error message.User can enter phone number with -,+,. pattern.
So I have created key like


but it still allows user to enter phone digit less than 10.I thought giving value like
'^[\d{10,10}\-\+\.]+$' means user can enter only 10 digits and user can enter phone number with -,+ and . expression.Can anyobdy help me with the regex pattern.Where user can enter only phone number with minimum 10 digit and +,- amd . can be used and there should be no manixmum limit for entering digit.

View Complete Post

More Related Resource Links

RequiredFieldValidator minimum 6 number

Hi,This my code:<asp:RequiredFieldValidator ID="RequiredFieldValidator2" ValidationExpression="^[a-zA-Z0-9]{6,}$" runat="server" ControlToValidate="CreditCardNumber"  ErrorMessage="Stevilka kreditne kartice, ki ste jo vnesli, ni veljavna!"                 ValidationGroup="ErrormessageValidationGroup">!!!!!!</asp:RequiredFieldValidator>ValidationExpression not works! The condition must be at least 6 numbers before it is implemented.thanks

Getting IMEI number of a mobile phone

I am developing an  asp.net web application which supplies content to mobile phones  , Im trying to get the imei number of  mobile phones using thier numbers. How can we achieve this?

Format phone number in asp.net textbox control

Hi,  I have a <asp:textbox> control, I want to display text as a phone number format like phone number mask. Anybody can help on this. Thanks in advance.

Phone number dialer


Hi everybody

I need to make an application that dial a phone number and then register the response status for statistics issue (if it was connected, if the line is busy, etc)

How can I manage those signals? May I use SerialPort object?

Please, if you have some example code, I will appreciate so much

Thanks in advance

Dr CRs


Retrieve caller ID number from VOIP phone

I am wanting my program to be able to retrieve the caller ID number when a call is received through my VOIP phone.  I know this is possible but I need someone to point me in the right direction of how I would go about this.

Thanks for any help

what is the "." for in a phone number regex?

      string phone = "973 555-7241";
      string pat = @"^\d{3}[- .]?\d{3}[- .]?\d{4}$";
      Match rv = Regex.Match(phone, pat);

What does the "." in the section "[- .]" of the above regex pattern mean?

I understand "." to mean 'any char but newline". Square brackets contain a set of chars, any of which can match the current character. [ -] means "either space char or dash char".  I read "[- .]" to mean any of "dash, space or any char other than new line".  But something like 973x555-1212 does not match the regex.



User profile sync - Replication of manager, physical office location and work phone number back to a


SharePoint 2010 user profile synchronisation successfully up and running following the super guide from Harbar (thank you!).

Setup the property for first name to replicate back into active directory and this has worked perfectly.

Now trying to configure the following functionality and getting issues.

1] Allow the users to edit the manager property and replicate back into AD

2] Allow the users to change their phone number and replicate back to active directory

3] Allow the users to edit the office location using a drop down list.

So these are the problems

1] Allow the users to edit the manager property and replicate back into AD

Have made the property editable and the users can change it.  The org chart browser works using the new values.  The profile property, however, will not allow you to set is as 'user overridable' in central admin and it never goes back into AD.  Indeed there is a warning displayed in the users my site to this effect.

2] Allow the users to change their phone number and replicate back to active directory

Have made the property editable and the users can change it.  The profile property, however, will not allow you to set is as 'user overridable' in central admin and it never goes back into AD.  Indeed there is a warning displayed in the users my site to t

Phone Number Input Mask


I am fairly new to MVC.  I have a html helper textbox for phone number .  I am trying to apply a input mask of xxx-xxx-xxxx to th phone number html helper.  I even downloaded the Digital Bush Masked Input Plugin but it doesn't even work.  Can someone provide me some guidance on this matter.

Regular Expression For US Phone Number in C#?

Hello friends,

If you know regular expression for US phone validation please let me know. I have used

^[01]?[- .]?(\([2-9]\d{2}\)|[2-9]\d{2})[- .]?\d{3}[- .]?\d{4}$  expression . But it is fine for 10 digit numbers validation. I may have 12 digit numbers like 23-456-213-765  .  What is the regular expression for this?

Set contents of textbox when click to call phone number


So I have a text box


li class="textwidth">   
<label class="labelwidth" for="txtLine1">
    Phone #:</label>   
<asp:TextBox ID="txtPhoneNumber" runat="server" Width="202px" onkeydown="javascript:backspacerDOWN(this,event);" onkeyup="javascript:backspacerUP(this,event);" CssClass="inputwidth"></asp:TextBox>

When they click on this or when they click on something by this textbox I want it to call the phone number.

The ACTUAL phone number is filled in the pageload event:

If Not (SPPhone Is Nothing) Then
            Me.txtPhoneNumber.Text = SP.PhoneNumber

I know about the <a href="tel but I don't understand how I can implement it, since I don't know the phone number until the page actually loads.

Thanks for any and all help!

Building a Searchable Phone Directory with Windows SharePoint Services

I want to continue to build out the intranet site we've started in our previous articles. A standard item in every intranet is a staff/employee list. Most companies implementing Windows SharePoint Services (WSS) are large enough to have a database that contains all employees. We will use the aggregation features of SharePoint to include data from this database into our intranet.

Use a Windows Mobile Phone as a Bluetooth Modem

Many Windows Mobile Pocket PC Phones and Windows Mobile Smartphones can be connected to a Windows PC via Bluetooth for use as a wireless dial-up modem. If your Windows Mobile device supports Bluetooth Dial-Up Networking, or Bluetooth DUN, and your Windows PC Bluetooth-enabled, you have everything you need.

In this tutorial, we'll show you how to use Windows Mobile Pocket PC Phones or Smartphones as a Bluetooth modem for Windows XP PCs.

Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.

dynamically adding sql server columns based on number of files in fileuploader


I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.


I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!


Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")


Embeb a variable number of videos


I need to provide some alternate content for my non-Flash users.

I have a directory of video files that is scanned using the DirectoryInfo() function, and I want to use the results to embed all files ending in ".mov" in QuickTime players on a web form.

How would you approach this? Right now I am using the count on the array of videos to determine how many times to repeat the embed code.  But this seems inelegant.

Is there a way to have a single QuickTime player.ascx control that gets duplicated according to the number of videos available for display?

how implement transformations in slideshow extender.



i am working on ajax slideshow extender.

can anybody help in coding for 

1) implement transformations between slide to slide.

2) and the direction means orientation in changing of slides.

I hope u got my querries.

please help in this regard.

thanks in advance.

Article commenting by line number


I'm wondering what's the best way to approach an online article system that allows users to comment by clicking on the line they are commenting about? Essentially the same way Adobe Acrobat works with comments where you can click anywhere and the text is saved for that location.

I'm assuming a mix of jQuery would be the crux of the interface. The system would need to save comments so that when another user logs in, they will also see the other comments but they can´t edit them - only add their own.

Any suggestions would be great.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend