I am using ASP:FileUpload Control for uploading the PDF files. I have limited the upload file size to 1MB in Web.Config like this.
<system.web>
<httpRuntime maxRequestLength="1024" executionTimeout="360"/>
</system.web>
ASPX code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebpageUpload.WebForm1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
Normal File Upload...
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Clear" OnClick="Button1_Click" />
</div>
</form>
</body>
</html>
Here the main issue is, When i upload a file more than 1 MB and click on Clear button, I am getting "Internet Explorel Cannot display this webpage."
Please find the Image for reference..
Thanks in advance...