I'm trying to convert code from a WinForm to a WinApp, but I know very little of aspx, and nothing of javascript.
I have programmatically created a textbox that will be given text. The text is then passed through a validation method like so:
text.Validating += new CancelEventHandler(boolean_Validating);
goes to
private void boolean_Validating(object sender, CancelEventArgs e)
{
TextBox textBox = (TextBox)sender;
string boolean = textBox.Text;
string message = null;
if (!checkBooleanSyntax(boolean, out message))
{
Response.Write("Error: " + message);
e.Cancel = true;
textBox.Text = message;
}
}
ASPX doesn't have a definition for the text.Validating
part. How else can I validate the text using a Cancel Event Handler?