public static bool CompareTypes(string leftText, ValidationDataType type) { System.Web.UI.WebControls.ValidationDataType vdt = (System.Web.UI.WebControls.ValidationDataType)Enum.Parse( typeof(System.Web.UI.WebControls.ValidationDataType), type.ToString()); return(BaseCompareValidator.CanConvert(leftText, vdt)); }
protected void pageNumberValidate(object sender, ServerValidateEventArgs e) { return; int pageNum; TextBox txtPage = ((TextBox)FindControlRecursive(grdSearchResults, "txtPageJump")); Label lblPageErr = ((Label)FindControlRecursive(grdSearchResults, "lblPageError")); string errText = "Please enter valid page number"; e.IsValid = false; if (e.Value != null) { if (!BaseCompareValidator.CanConvert(e.Value, ValidationDataType.Integer)) { txtPage.Text = "1"; } else { pageNum = Convert.ToInt32(e.Value); if (pageNum <= grdSearchResults.PageCount) { e.IsValid = true; } else { txtPage.Text = grdSearchResults.PageCount.ToString(); } } } else { txtPage.Text = "1"; } return; }
public new bool CanConvert(string text, ValidationDataType type) { return(BaseCompareValidator.CanConvert(text, type)); }
public static bool CanConvert(string text, System.Web.UI.WebControls.ValidationDataType vdt) { return(BaseCompareValidator.CanConvert(text, vdt)); }