its urgent please check this once
hii i hav a problem with thsi code
check it once
if (!this.IsPostBack)
// Create a random code and store it in the Session object.
this.Session["CaptchaImageText"] = GenerateRandomCode();
else
{
// On a postback, check the user input.
if (this.CodeNumberTextBox.Text ==
this.Session["CaptchaImageText"].ToString())
{
// Display an informational message.
this.MessageLabel.CssClass = "info";
this.MessageLabel.Text = "Correct!";
}
else
{
//Display an error message.
this.MessageLabel.CssClass = "error";
this.MessageLabel.Text = "ERROR: Incorrect, try again.";
// Clear the input and create a new random code.
this.CodeNumberTextBox.Text = "";
this.Session["CaptchaImageText"] = GenerateRandomCode();
}
}
}
the second else is directly executing without anywrong entry of text
so please tell how to correct thsi code