Response.Redirect in Asp.Net
Response.Redirect is very similar to HyperLink control. But the basic difference is HyperLink does not expose any server side event. For example if we want a button and when we click on button, we want to go to Page2.aspx .
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("~/Page2.aspx");
}
Response.Redirect change the URL in address page and it can be used to navigate pages/website on the same web server or on a different web server.
It has two overloading versions:
Response.Redirect(URL,true) :- Client is redirected to a new page but the processing of the current page is aborted.
Response.Redirect change the URL in address page and it can be used to navigate pages/website on the same web server or on a different web server.
It has two overloading versions:
- Response.Redirect(string Url);
- Response.Redirect(string Url,bool endResponse);
Response.Redirect(URL,true) :- Client is redirected to a new page but the processing of the current page is aborted.
No comments:
Post a Comment