J
Joe Bonavita
In the click event of the button I do some validation. If everything is
valid the code falls through to a Server.Transfer("nextpage.aspx");
The problem is if I leave in the Server.Transfer("nextpage.aspx"); it just
tries to go to the next page and doesn't do the validation. Why? It's almost
like memory becomes corrupt (like in C++).
the code looks like this:
private void ImageButton2_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
if (TextBoxTo.Text.Length == 0)
DisplayMessage("The To: Email address is empty. Enter an email address and
try again.");
if (!IsEmailOfValidForm(TextBoxTo.Text) )
DisplayMessage("The To: Email address is not of a valid form.");
if (TextBoxFrom.Text.Length == 0)
DisplayMessage("The From: Email address is empty. Enter an email address and
try again.");
if (!IsEmailOfValidForm(TextBoxFrom.Text) )
DisplayMessage("The From: Email address is not of a valid form.");
if (TextBoxMessage.Text.Length == 0)
DisplayMessage("You must enter a message for your card. Enter a message and
try again.");
if (!CheckBoxYes.Checked)
DisplayMessage("You must check the 'Yes' box to confirm that everything is
ok.");
Server.Transfer ("checkout.aspx");
}
valid the code falls through to a Server.Transfer("nextpage.aspx");
The problem is if I leave in the Server.Transfer("nextpage.aspx"); it just
tries to go to the next page and doesn't do the validation. Why? It's almost
like memory becomes corrupt (like in C++).
the code looks like this:
private void ImageButton2_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
if (TextBoxTo.Text.Length == 0)
DisplayMessage("The To: Email address is empty. Enter an email address and
try again.");
if (!IsEmailOfValidForm(TextBoxTo.Text) )
DisplayMessage("The To: Email address is not of a valid form.");
if (TextBoxFrom.Text.Length == 0)
DisplayMessage("The From: Email address is empty. Enter an email address and
try again.");
if (!IsEmailOfValidForm(TextBoxFrom.Text) )
DisplayMessage("The From: Email address is not of a valid form.");
if (TextBoxMessage.Text.Length == 0)
DisplayMessage("You must enter a message for your card. Enter a message and
try again.");
if (!CheckBoxYes.Checked)
DisplayMessage("You must check the 'Yes' box to confirm that everything is
ok.");
Server.Transfer ("checkout.aspx");
}