Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aspx page to redirect to a new page

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.

like image 583
Stoob Avatar asked Jul 07 '09 15:07

Stoob


People also ask

How do I redirect from one ASPX page to another?

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.

How do I redirect a website to another page?

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.

How do you call an ASPX page from another ASPX page?

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.


1 Answers

<%@ Page Language="C#" %> <script runat="server">   protected override void OnLoad(EventArgs e)   {       Response.Redirect("new.aspx");   } </script> 
like image 154
Darin Dimitrov Avatar answered Sep 22 '22 23:09

Darin Dimitrov