.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

Phone Number Input Mask

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

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.

View Complete Post

More Related Resource Links

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

Return of sequential number on user input



I'm new to this forum and just as new to asp :/

I have been tasked with what on the surface seems a simply problem. I need to provide users with a method of entering an order number and in return they are given the next sequential number (seeded from a resetable number). As each order number is entered and sequential number is returned and a list of all entries/outputs is maintained.

user 1 enters a number, returns 1

user 2 enters another number, returns 2

user 3 enters any number even a repeat of previous number, returns 3

A text file or similar is maintained with results




etc etc

I was going to do this with PHP but its no longer an option, I have IIS available so can be done via web form / asp / sql.

Would anyone be able to give me some pointers?

thanks very much

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


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.

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?

CLR Stored procedures : variable number of input paramters?


Hi there, I've just started looking into CLR stored procedures.

I'd like to create a stored procedure that takes in a variable number of parameters in the same way that sp_executesql does. 

I've tried creating the CLR proc as follows;

using System;
using System.Data.SqlTypes;
using System.Data.SqlClient;
using Microsoft.SqlServer.Server; 

public class StoredProcedures 
  public static void PriceSum(params SqlString[] parms)


but this results in the following error;

Error	1	Column, parameter, or variable #1: Cannot find data type SqlString[].	StringFactory

so I'm guessing it can't be done. 

Is there a way to mimic sp_executesql ?

Restrict Number of Input Fields


How do I restrict the number of input fields in the form to match the size of the columns?

Table Columns Reads:

state: Type Char; Length: 2
zip: Type: char; Length: 5   
Phone: Type: char; Length: 12    
Fax: Type: char; Length: 12     
Email: Type: nvarchar; Length: 256 

BoundField Reads:

<asp:BoundField DataField="state" HeaderText="State:" SortExpression="state" />

<asp:BoundField DataField="zip" HeaderText="Zip Code:" SortExpression="zip" DataFormatString="{0:#####}" />

<asp:BoundField DataField="phone" HeaderText="Phone Number:" SortExpression="phone" DataFormatString="{0:(###) ###-####}" />

<asp:BoundField DataField="fax" HeaderText="Fax Number:" SortExpression="fax" DataFormatString="{0:(###) ###-####}" />

<asp:BoundField DataField="email" HeaderText="Email Address:" SortExpression="email" DataFormatString="&lt;a href=mailto:{0}&gt;{0}&lt;/a&gt"


Validate a certain number of input tags


My users will add text to be translated.
Inside the text we would like to allow a certain number of tags.
Most of them will be simple formatting but some can be extended to cover reserved words etc.

Now we would like to validate user input to ensure correct entries.

The assumption is to use HTML like formatting tags like: <b>, <br/>, <ul>, <li>, etc.
Even definitions could probably be covered by HTML if using something like: <code>, <cite>, <dfn>
This means it is fully possible to limit tags to valid HTML if that helps.

My initial guess is that Regex is faster since we will only allow a very limited number of tags.
But that validation soon becomes very complex, especially if we allow nested tags which is very much preferred and even necessary for <ul> lists.

Is there maybe a XHTML validator that might be possible to use?

I saw that TinyMCE has a similar input validation, but I am not able to detect how they actually process and apply it.
I still would prefer C# based solution over javascript.

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!

Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).

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.
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