protected void btnOkay_Click(object sender, EventArgs e)
{
Boolean blBill = checkBill();
if (blBill == true)
{
SqlCommand cmdRegistrationID = new SqlCommand("SELECT RegistrationID FROM Registration WHERE RegistrationID = @id", conOOC);
cmdRegistrationID.Parameters.AddWithValue("@id", txtRegistrationID.Text);
conOOC.Open();
SqlDataReader dtrRegistrationID = cmdRegistrationID.ExecuteReader();
if (dtrRegistrationID.HasRows)
{
while (dtrRegistrationID.Read())
{
Server.Transfer("Make Payment.aspx", true);
}
}
else
{
Response.Write("<script>alert('Record Not Found.! Please Enter Correctly.');</script>");
txtRegistrationID.Focus();
txtRegistrationID.Attributes.Add("onfocus", "this.select();");
}
conOOC.Close();
}
else
{
Response.Write("<script>alert('You've Already Made The Payment. Thank You.');</script>");
}
when the blBill = true and if the dtrRegistrationID.HasRows = false it will go to "else" statement and show the messagebox popup. It's success to display but if the blBill = false, it doesn't show any messagebox popup. Anyone know why? @@