What is the code required to redirect the browser to a new page with an ASPX page?
I have tried this on my page default.aspx :
<% Response.Redirect("new.aspx", true); %>
or
<%@ Response.Redirect("new.aspx", true); %>
And these resulted in a server error that is undetermined. I cannot see the error code; because the server is not in my control and the errors are not public.
Please provide all necessary code from line 1 of the page to the end, and I would really appreciate it.
If you've got other processing to do server-side and you need to redirect afterwards, use Response. Redirect("Webform2. aspx"); in your click handler.
The simplest way to redirect to another URL is to use an HTML <meta> tag with the http-equiv parameter set to “refresh”. The content attribute sets the delay before the browser redirects the user to the new web page. To redirect immediately, set this parameter to “0” seconds for the content attribute.
Transfer("default. aspx"); // At URL You will not Get the default page as what you are redirecting to. example : If you are logged in Login page then you want to redirect to default page ,then you can use both the above mentioned methods.
<%@ Page Language="C#" %> <script runat="server"> protected override void OnLoad(EventArgs e) { Response.Redirect("new.aspx"); } </script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With