本文整理汇总了C#中Validator.IsRegularExp方法的典型用法代码示例。如果您正苦于以下问题:C# Validator.IsRegularExp方法的具体用法?C# Validator.IsRegularExp怎么用?C# Validator.IsRegularExp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Validator
的用法示例。
在下文中一共展示了Validator.IsRegularExp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsValid
/// <summary>
/// Returns true if user control is valid.
/// </summary>
public override bool IsValid()
{
if (!DataHelper.IsEmpty(txtZIPCode.Text.Trim()))
{
// US ZIP Code must have 5 digits.
Validator val = new Validator();
string result = val.IsRegularExp(txtZIPCode.Text, @"\d{5}", "error").Result;
if (result != "")
{
this.ValidationError = GetString("USZIPcode.ValidationError");
return false;
}
}
return true;
}
示例2: IsValid
/// <summary>
/// Returns true if user control is valid.
/// </summary>
public override bool IsValid()
{
if ((txt1st.Text != "") || (txt2nd.Text != ""))
{
Validator val = new Validator();
// International phone number must be in the form '+d{1-4} d{1-20}' where 'd' is digit.
string result = val.IsRegularExp(txt1st.Text, @"\d{1,4}", "error").IsRegularExp(txt2nd.Text, @"\d[0-9\s]{1,18}\d", "error").Result;
if (result != "")
{
ValidationError = GetString("InternationalPhone.ValidationError");
return false;
}
}
return true;
}
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:19,代码来源:InternationalPhone.ascx.cs
示例3: IsValid
/// <summary>
/// Returns true if user control is valid.
/// </summary>
public override bool IsValid()
{
if (IsEmpty())
{
return true;
}
// US phone number must be in form: (ddd) ddd-dddd, where 'd' is digit
Validator val = new Validator();
string result = val.IsRegularExp(txt1st.Text, @"\d{3}", "error").IsRegularExp(txt2nd.Text, @"\d{3}", "error").IsRegularExp(txt3rd.Text, @"\d{4}", "error").Result;
if (result != "")
{
ValidationError = GetString("USPhone.ValidationError");
return false;
}
return true;
}