473,395 Members | 1,629 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,395 software developers and data experts.

Handling 'Maximun Length Exceed' error in global.asax

Hi,

I am trying to handle th HttpException raised when you upload a file
too big. I changed the property maxRequestLength and I set it to 10000,
but I what to notice the user that the file is too big.
Finally I could handle this error at global.asax level, but when I try
to tranfer to the same page including an error flag in the session, it
takes about 10 seconds to transfer to the page and it look like my
browser shows a page from cache, it doesnt show the page processed
again because it should show the error message. If I reload the page,
then the error message appears so I am pretty sure that its a cache
problem.

I had already disabled the cache settings in my internet explorer...
:-?
maybe is it taken the page from some cache in .NET?

any idea?
any suggestion??

Thank you very much in advance
Jose

My code:

protected void Application_Error(Object sender, EventArgs e)
{
if (Server.GetLastError().InnerException.GetType().To String() ==
"System.Web.HttpException")
{
log.Error("Aplication_Error :" +
Server.GetLastError().InnerException.Message );
Server.ClearError();
Session["Error"] = "El fichero no puede exceder los 20Mb de
tamaño.";
Server.Transfer(Request.RawUrl);
}
}

Feb 3 '06 #1
0 908

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

Similar topics

13
by: R Reyes | last post by:
is there a way to avoid the validateRequest error page in my code behind file? i can't seem to find a way to handle the error w/o an error code or exception being thrown... i am NOT looking for...
1
by: VSK | last post by:
Hi all, For a web application if we are using web farm, and if i want to do Global Error handling can i use Applicatio_Error() method in global.asax. Now in this method i will call business...
3
by: Mr Newbie | last post by:
I'm testing error handling configurations and having some trouble. I created a WebForm called. ErrDefault.aspx and I am trying to use the Page error attribute to force the redirection to a custom...
5
by: OHM | last post by:
Hi everyone, I have a problem with error handling and wondered if anyone has managed to implement a global exception handling model. Is it possible to ensure that you see all exceptions before...
8
by: jcrouse | last post by:
I am using the following code to trap errors in a sub routine: Try Executable code Catch ex As Exception Dim strInputE As String = Application.StartupPath & "\Error.txt" Dim srE As...
6
by: RonL | last post by:
What is the recommended best technique for handling errors/exceptions in ASP.Net. I've read about the following techniques: 1. Try/Catch 2. Page_Error 3. Application_Error in the...
1
by: vikram | last post by:
I want to provide a custom erro handler for my application. henc I decided to handle all error in Global.asax application_error event and then process the error respectively. Is there any problem...
7
by: Jason Kester | last post by:
Best I can tell, there are three basic ways you can deal with global error handling in ASP.NET. Namely: 1. Derive all your pages from a custom Page class, and override OnError() 2. Specify a...
2
by: rpradeepa | last post by:
Hi, For handling the errors globally, i did some thing in web configuration file and global.asax file In web configuration <customErrors mode="Off" defaultRedirect="Err.htm"></customErrors> ...
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.