We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

MaskEditTextbox

Can i use the MaskEditText box to valid domestic phone numbers as well as international numbers?


1 Reply

VR Varalakshmi R.S Syncfusion Team February 4, 2011 07:53 AM UTC

Hi Corinne,

Thank you for your interest in Syncfusion products.

Yes, the MaskEditText box can be used to validate domestic phone numbers as well as international numbers. Please refer the below code snippet to achieve this,


[ASPX]
Choose type:
onselectedindexchanged="RadioButtonList1_SelectedIndexChanged">
International
Domestic



[C#]
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
MaskedEditTextBox1.Value = "";
string s=RadioButtonList1.Text;
if (s == "International")
{
MaskedEditTextBox1.Mask = "(###) ###-####-####";
}
else
{
MaskedEditTextBox1.Mask = "C## #### ####";
}
}


Kindly let us know your concerns.

Regards,
Varalakshmi.R.S




Loader.
Live Chat Icon For mobile
Up arrow icon