Quantcast
Channel: ASP.NET / ASP.NET Core
Viewing all articles
Browse latest Browse all 108

File size limit: System.Web.HttpException

$
0
0
Hello

I have an file upload button on an aspx file. The file size limit, defined in Web.config is: 500Kb. When I deliberately go over that amount to test it, I get the following error:

System.Web.HttpException: Maximum request length exceeded.

Instead of sending the user to that page, how would I 'trap' his 'misdemeanour' and show an error message on the page?

This is what should show the error on screen in my aspx file:

Code:
<asp:labelid="messageArea"...
File size limit: System.Web.HttpException

Viewing all articles
Browse latest Browse all 108

Trending Articles