Mobile Number textbox1;
Mobile Number should be 10 Digit validation
if (txt_mobile.Text.Length < 10)
{
LblErr.Text = "Enter Correct Mobile Number";
return;
}
Mobile Number start with 0 Validation
if (txt_mobile.Text.StartsWith("0"))
{
LblErr.Text = "Dont start with Mobile Number 0 ";
return;
}
i written the two validation
But i want that two validation to be written in one condition(like one validtion in that both validation should satisfy)
how to do .
please give the code from my above code.

Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Dec 26, 2012, 9:33 PM EST
//Do next thing
else
//throw error message
Amit ChoudharyRank #145 · 15.8K reputationPosted Dec 26, 2012, 10:42 PM EST
using System.Text.RegularExpressions;
Here's the code for mobile validation:
public bool IsCorrectMobileNumber(String strNumber)
{
Regex mobilePattern = new Regex(@"^[1-9]\d{10}$"); return !mobilePattern.IsMatch(strNumber);
}
Pawan Chand157 reputationPosted Dec 26, 2012, 11:17 PM EST
Amit ChoudharyRank #145 · 15.8K reputationPosted Dec 26, 2012, 11:39 PM EST