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

cancel POST request

Hi All,

I have next problem.

A page contains HtmlInputFile. User tries to upload file. File size is
too large, so I can't allow this request.

Now I have DNS error accoeding to MSDN

When uploading large files, use the maxRequestLength attribute of the
<httpRuntime> element to increase the maximum allowable file size. A DNS
error is generated in the browser when the file exceeds the specified size.

I want simply intercept this situation and redirect user to a special
error page, no more. In other words, I want to cancel this POST request
and force IIS to do a GET request to a special aspx page.

But I couldn't. I get only event BeginRequest in global.asax.vb. I tried
to user Redirect, RewritePath but without success. As for Page_Init,
Page_Load - I even do not got them.

How can I do it ?
Jun 2 '06 #1
3 2498
Double check the call stack but If I remember this exception is triggered
before your own code runs... If yes, the simplest solution could be to test
the content length in your global error handler to suggest the user to try
again with a smaller file...

--
Patrice

"Pavel Dvorkin" <dv*****@omsu.ru> a écrit dans le message de news:
eS**************@TK2MSFTNGP04.phx.gbl...
Hi All,

I have next problem.

A page contains HtmlInputFile. User tries to upload file. File size is too
large, so I can't allow this request.

Now I have DNS error accoeding to MSDN

When uploading large files, use the maxRequestLength attribute of the
<httpRuntime> element to increase the maximum allowable file size. A DNS
error is generated in the browser when the file exceeds the specified
size.

I want simply intercept this situation and redirect user to a special
error page, no more. In other words, I want to cancel this POST request
and force IIS to do a GET request to a special aspx page.

But I couldn't. I get only event BeginRequest in global.asax.vb. I tried
to user Redirect, RewritePath but without success. As for Page_Init,
Page_Load - I even do not got them.

How can I do it ?

Jun 2 '06 #2
Patrice wrote:
Double check the call stack but If I remember this exception is triggered
before your own code runs... If yes, the simplest solution could be to test
the content length in your global error handler to suggest the user to try
again with a smaller file...


At Application_Error ? Unfortunately, it doesnt' occur at this case. And
I have no exception. I simpy have a browser winodw with

The page cannot be displayed
Jun 2 '06 #3
Patrice wrote:
Double check the call stack but If I remember this exception is triggered
before your own code runs... If yes, the simplest solution could be to test
the content length in your global error handler to suggest the user to try
again with a smaller file...


At Application_Error ? Unfortunately, it doesn't occur at this case. And
I have no exception. I simpy have a browser window with

The page cannot be displayed
Jun 2 '06 #4

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

Similar topics

17
by: Larry Woods | last post by:
I have a server page that has served an HTML page with a "Cancel" button on it, BUT this server page has not completed and is running a 15-30 second process before it completes. I want the browser...
2
by: Stephen | last post by:
I have code which checks whether a datagrid is empty and if it is it shows a panel on my page. If its not empty then Im using the server.transfer to go to another page so as im able to use the...
1
by: Daniel | last post by:
in Application_BeginRequest how do i cancel the request and send back a message?
7
by: theyas | last post by:
How can I get my code to NOT display two "Open/Save/Cancel/More Info" dialog boxes when using the "Response.WriteFile" method to download a file to IE I've asked about this before and didn't get a...
6
by: Ken Varn | last post by:
I have an ASP.NET form that may take a very long time to process a particular request. If the user closes the browser window, the request will continue to process until it completes. This is a...
2
by: Steve | last post by:
After running into a design wall with my traditional thread approach, I realized that a BackgroundWorker object would fit my needs pretty good. Never really used them before. In a nutshell, my...
1
by: Sergey Zuyev | last post by:
Hello all I have simple edit form. When user saves data that contains restricted characters such as (< , etc.) , regular expression validator will display a warning message. It all works fine,...
0
by: darfur | last post by:
I'm writing an application that simplifies the interface to a few websites I use at my job. One of the web servers has a tendency to cause my program to throw a time out exception for a variety of...
16
by: parez | last post by:
I start a BackGroundWorker to populate a grid. It is started off in the ui layer The thread follows( cannot think of a better word) the path UI->Layer1->Layer2->Communication Layer and it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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.