473,699 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Customize Error Message caused by uploading big file? (No DNS error)

Hi all,

When user upload a file, there is a size limit (default is 4M). And we
can change this size limit by changging the config file.
If a user upload a file bigger than this size, an DNS error will be
displayed.
Now my question is whether we can customize this error message?
Displaying a DNS error page is quite misleading to normal user.
I would rather display a page saying "The file you upload should not
exceed 4M" and then put a link there for the user to go back to
previous page.
Is this possible?

Thank you.

Henry
Nov 18 '05 #1
1 1196
Yes, it is possible

put the upload inside of a try/catch block

tr

// uploa

catch(Exception ex) // or the more specific DNS Exception you receiv

// if it is a DNS Exceptio
lblErrors.Text = "The file could not be uploaded. Files over 4mb are not allowed. Please check the file size and try again.
}
Nov 18 '05 #2

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

Similar topics

1
4497
by: B Golash | last post by:
Hi I`m trying to install a third-party control. During the install I receive this error...see the url below. I have no idea as to the meaning of the error. www.woodsolutions.com/download/ErrorLoadComp.jpg
0
1698
by: piyushc | last post by:
Hi, I am having problem creating new project using VS.Net 2003. Whenever I am trying to create new project (any type) it shows error message "Error writing the project file. Error loading type library/DLL". I faced this problem before and it was solved when I reinstall the
8
7829
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the VALUE ENTERED BY THE USER EXISTS IN THE DB , then THE ERROR MESSAGE OF THE COMPARE VALIDATOR SHOULD BE DISPLAYED. For this, I used the reference artiicle "http://msdn.microsoft.com/library/default.asp?url=/library/en-...
4
2076
by: Mark | last post by:
Hello - I receive the error message: System.Runtime.InteropServices.COMException: The remote procedure call failed. when I open an Excel file using from an ASP.Net page. Imports Microsoft.Office.Interop Imports System.Runtime.InteropServices.Marshal Public Sub LoadData()
0
2150
by: info | last post by:
Hi, Is it possible to include in the Schema validation file, every custom error message for each validation rules? This mean, in the same xsd file we can have the validation rules (patterns) and the custom error message throw during validation for the end user. I know .NET enable it using errorMessage tag, but with a standard W3C java validation ... If is it possible, does it works in IE too? Like that the same XSD file could be...
2
1076
by: ashokingroups | last post by:
Hi, I'm not getting clear idea on how to work with EventLog in ASP.NET. My doubt is: How to use the EventLog class with the Application_Error subroutine in the Global.asax file to automatically log all errors in ASP.NET application to a server Event Log. And how can we view entries in the "CustomLog" event log?
0
933
by: kong10 | last post by:
I have finish develop my program in ASP.NET. it can be run in Windows XP. When I try to move my Program from Windows XP to Windows 2003 Server. My program prompt out an error like below:- Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. Could anyone Help me???...
0
2694
by: RaviRajhulk | last post by:
I am trying to execute a batch file from a perl code and its executing fine with the folowing code Code: ( text ) `C:\temp\sample.bat` ,but another problem is occuring.....when there is some error in the .bat file(sample.bat) the perl should not execute it,and should throw some error message,but in case of error in the .bat file also,it is executing........Is there any way to capture in the perl code that if there is some error in the...
1
3576
by: amit dhiman | last post by:
sir i m just trying to exicute the code <%@ Page Language="C#" ContentType="text/html" ResponseEncoding="utf-8" %> <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head>
0
8615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8911
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8882
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6533
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5872
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2345
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.