My signUp button event is
protected void signup_Click(object sender, EventArgs e)
{
string con = ConfigurationManager.ConnectionStrings["connection"].ConnectionString;
SqlConnection conn = new SqlConnection(con);
conn.Open();
if (selectques.SelectedItem.Text == "Write your own question?")
{
SqlCommand cmd = new SqlCommand("insert into registration values('" + username.Text + "','" + passwrd.Text + "','" + emailadd.Text + "','" + alterquestion.Text + "','" + securityanswer.Text + "')", conn);
cmd.ExecuteNonQuery();
Response.Redirect("Login.aspx");
try {
ClientScript.RegisterStartupScript(Page.GetType(), "Message", "alert('Successful Registered');window.location='login.aspx';", true);
}
catch(Exception ex)
{
}
}
else
{
SqlCommand cmd = new SqlCommand("insert into registration values('" + username.Text + "','" + passwrd.Text + "','" + emailadd.Text + "','" + selectques.Text + "','" + securityanswer.Text + "')", conn);
cmd.ExecuteNonQuery();
Response.Redirect("login.aspx");
try
{
ClientScript.RegisterStartupScript(Page.GetType(), "Message", "alert('Successful Registered');window.location='login.aspx';", true);
}
catch (Exception ex)
{
}
}
}
After registering successfully how can I show a message of Successful Registered on login page or on the same page. I want to show the message through Popup window or messagebox.
Remove both
Response.Redirect("Login.aspx");and check.