473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Object Moved to here

Hi Experts,

I am getting the following error when I do a Response.Redirect from an aspx
page to another aspx page. I am using the following code in my global.asax
Application_Error event to redirect to an error page.

Session["Error"] = Server.GetLastError();
Response.Redirect("Error.aspx");

However I am not able to go to the Error Page and am getting this error.

I am getting the error "Object Moved to Here". All other pages in the
application are working well. This is an error page which I added in an
already working application. I wrote code in the Global.asax to redirect to
the error page on an unhandled error.

I searched the web and somewhere I got an instruction to add the following
lines to the code

Response.Expires = 0;
Response.Buffer = true;
Response.Clear();

I added those lines but still am getting this error. I am getting the error
only in the production site and not in my development environment.

Can anyone please help me get out of this urgent issue.

Thanking you in advance

Regards
Ganesh
Nov 19 '05 #1
1 3402
Add Server.ClearError() to your Application_Error

Session["Error"] = Server.GetLastError();
Server.ClearError();
Response.Redirect( "Error.aspx" );

Couple things of note. Not all application errors have a Session context
attached to them. You probably want to check

if ( System.Web.HttpContext.Current != null )
{
System.Web.HttpContext.Current.Session["Error"] = Server.GetLastError();
}

HTH,

bill

"Ganesh Ramamurthy" <Ga**************@discussions.microsoft.com> wrote in
message news:82**********************************@microsof t.com...
Hi Experts,

I am getting the following error when I do a Response.Redirect from an aspx page to another aspx page. I am using the following code in my global.asax
Application_Error event to redirect to an error page.

Session["Error"] = Server.GetLastError();
Response.Redirect("Error.aspx");

However I am not able to go to the Error Page and am getting this error.

I am getting the error "Object Moved to Here". All other pages in the
application are working well. This is an error page which I added in an
already working application. I wrote code in the Global.asax to redirect to the error page on an unhandled error.

I searched the web and somewhere I got an instruction to add the following
lines to the code

Response.Expires = 0;
Response.Buffer = true;
Response.Clear();

I added those lines but still am getting this error. I am getting the error only in the production site and not in my development environment.

Can anyone please help me get out of this urgent issue.

Thanking you in advance

Regards
Ganesh

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Henry Rollins | last post by:
This is driving me nuts. I have created a Class Assembly in .NET C# which is to be used by traditional ASP pages. I registered it just fine with the regASM command and it work - about 2/3 of...
1
by: Daniel Bruno | last post by:
When I use redirection on ASP.NET I get the the message: "Object moved here". Then I have to click on the link to go to the destination page. Is there a way to prevent this from happening, so...
2
by: Boban Dragojlovic | last post by:
I'm building a complex web-based reservations system. Gathering the user's data requires between 8 and 15 pages (depending on which options they are interested in). I use the "Session" object to...
8
by: Brad | last post by:
In one of my asp.net apps a response.redirect is sometimes resulting in the blank page with "Object moved to here." I've tried repsonse.clear and response.buffer (true & false) but still get...
1
by: JohnZing | last post by:
i tried to install asp.net forums all went ok, but after login i always get "Object moved to here." in firefox or "The page cannot be displayed" in IE when i hit refresh, the page loads fine. ...
7
by: Brett | last post by:
I'm not sure why I keep getting this error, "Object reference not set to an instance of an object". Private Function somefunction() as string Dim MyCurrentClass As New Class1 Try For i As...
0
by: Ganesh Ramamurthy | last post by:
Hi Experts, I am working with asp.net C# to develop my web applications. Recently i had to modify one of my presently working applications. There was not much change except for a minor code...
7
by: Arpan | last post by:
The .NET Framework 2.0 documentation states that An Object variable always holds a pointer to the data, never the data itself. Now w.r.t. the following ASP.NET code snippet, can someone please...
2
by: Zester | last post by:
Hi, Sorry for this multi-posts; I don't know where the setting if it exists so I'm posting this to multiple groups. I was told that Response.Redirect would generate the http 302 Object Moved...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.