santhosh s samaka
santhosh s samaka

Reputation: 17

how to refresh the current window using c# in asp.net

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

Answers (2)

Fredrik Hu
Fredrik Hu

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

Coding Flow
Coding Flow

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

Related Questions