You can use the custome validation for this purpose:
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="ddlCountry" runat="server">
<asp:ListItem Text="India" Value="0" />
<asp:ListItem Text="Nepal" Value="1" />
<asp:ListItem Text="Pakistan" Value="2" />
</asp:DropDownList>
<asp:TextBox ID="txtPhoneNumber" runat="server" />
<asp:CustomValidator ID="cvPhoneNumber" runat="server" ControlToValidate="txtPhoneNumber"
ErrorMessage="Invalid PhoneNumber" ClientValidationFunction="CheckPhoneNumber"></asp:CustomValidator>
<asp:Button Text="Save" runat="server" />
<script src="Scripts/jQuery_1.8.3.js" type="text/javascript"></script>
<script type="text/javascript">
function CheckPhoneNumber(sender, args) {
var country = $('[id*=ddlCountry]').val();
switch (country) {
case "0":
if ($('[id*=txtPhoneNumber]').val().length != 10) {
args.IsValid = false;
}
break;
case "1":
if ($('[id*=txtPhoneNumber]').val().length != 7) {
args.IsValid = false;
}
break;
case "2":
if ($('[id*=txtPhoneNumber]').val().length != 8) {
args.IsValid = false;
}
break;
default:
args.IsValid = false;
}
}
</script>
</div>
</form>
Thank You.