Reputation: 17
if (TextBox1.Text == row["UserName"].ToString()
&& TextBox2.Text == row["Password"].ToString())
{
//here i have to reload the page
Button1.Attributes.Add("onclick", "alert('Login SucessFull')");
break;
}
Upvotes: 0
Views: 804
Reputation: 51
Maybe this is more what you want? It will show an alert and then redirect you to another page.
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "LoggedInScript", "alert('Login SucessFull'); window.location = 'MyLoggedInPage.aspx';", true);
Upvotes: 1
Reputation: 21881
When you say you need to "reload the page" do you mean redirect to another page becuase the user is now logged in? If you you use:
Response.Redirect("MyLoggedInPage.aspx")
Upvotes: 0