Is there a better way to do “input forms” in WebForms?
I always end up with code like this:
Double d = 0; // chuckle inside
if(Double.TryParse(myNumberTextField.Text, out d))
{
myObject.DoubleVal = d;
}
Is there a better way to process free-form “numeric” input.
You can validate the textbox using a compare validator, and then if the page passes validation use the double.Parse method.