Determines whether the specified string can be converted to the specified data type. This version of the overloaded method allows you to specify whether values are tested using a culture-neutral format.
- text
- The string to test.
- type
- One of the System.Web.UI.WebControls.ValidationDataType enumeration values.
- cultureInvariant
- true to test values using a culture-neutral format; otherwise, false.
true if the specified data string can be converted to the specified data type; otherwise, false.
Use the BaseCompareValidator.CanConvert(string, ValidationDataType, bool) method to determine whether the specified string can be converted to the specified data type. This method is commonly used to test whether a string can be converted to a compatible data type before performing an operation that depends on that data type. To indicate that values should be tested using a culture-neutral format, pass in true for the cultureInvariant parameter; otherwise, values are tested using the format used by the current culture. When testing a value using the format used by the current culture, consider using the BaseCompareValidator.CanConvert(string, ValidationDataType) overloaded version of this method.