0

When i click on the Submit Button and on the Button Click i have written a Response.Redirect to a new web page it firstly prompts a message.

Data you are sending will be redirected to another server. Continue?

If i say yes it gives an error Response Unknown.

  protected void Button1_Click(object sender, EventArgs e)
{
    Response.Redirect("Default2.aspx",false);
}
vini
  • 4,657
  • 24
  • 82
  • 170

2 Answers2

1

Try Server.Transfer("Default2.aspx");

This function save double trip to the server.

Response.Redirect() sends a redirection header to the client, and the client itself requests the new page.

Server.Transfer() stops rendering the current page and starts rendering another one.

Gregory Nozik
  • 3,296
  • 3
  • 32
  • 47
0

Try not to use the "false" only write:

Response.Resirect("Default2.aspx");
r.mirzojonov
  • 1,209
  • 10
  • 18