IT Community - Software Programming, Web Development and Technical Support

If you Receive error messages when you try to upload a file to an ASP.NET Web page b

This is a discussion on If you Receive error messages when you try to upload a file to an ASP.NET Web page b within the ASP and ASP.NET Programming forums, part of the Web Development category; Receiving messages when I try to upload a file to an ASP.NET Web page by using the FileUpload control ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-24-2007, 12:07 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Question If you Receive error messages when you try to upload a file to an ASP.NET Web page b

Receiving messages when I try to upload a file to an ASP.NET Web page by using the FileUpload control in IIS 5.1

Last edited by kingmaker : 07-24-2007 at 12:10 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-24-2007, 12:11 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: If you Receive error messages when you try to upload a file to an ASP.NET Web pa

Global.asax file of the Web application to capture the error and redirect the user to a custom error page. The Application_Error method may appear similar to one of the following code examples.

protected void Application_Error(Object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs.
// Determine whether the request originates from the file upload Web page (FileUpload.aspx).
if (Request.Path.EndsWith("FileUpload.aspx "))
{

// Obtain the error details.
HttpException httpEx = Server.GetLastError() as HttpException;

// Verify the expected error.
if (httpEx.GetHttpCode() == 500 && httpEx.ErrorCode == -2147467259)
{
Server.ClearError();

// Redirect the user to the custom error page (ErrorPage.aspx).
HttpContext.Current.Response.Redirect("ErrorPage.a spx");
}
}
}
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
upload file Kirubhananth ASP and ASP.NET Programming 5 03-13-2008 03:19 AM
Configuration Error Messages - Meanings arjkhanna Computer Hardware 0 01-16-2008 11:44 PM
How can I extract just the extension file name from a forms file upload field? itbarota HTML, CSS and Javascript Coding Techniques 1 10-22-2007 08:32 AM
Can I suppress JavaScript error messages? itbarota HTML, CSS and Javascript Coding Techniques 1 09-13-2007 03:09 AM
How to read inbox messages in windows mobile and create it as a text file using C#? mobilegeek Windows Mobile 4 08-17-2007 07:42 AM


All times are GMT -7. The time now is 08:33 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0