custom-errors

C# Remoting - How to turn off CustomErrors

I getting the following error when I try to connect to my server app using remoting: A problem seems to have occured whilst connecting to the remote server: Server encountered an internal error. For more information, turn off customErrors in the server's .config file. This is the code on my server app: TcpChannel tcpChannel = ne...

ASP.NET Custom 404 Returning 200 OK Instead of 404 Not Found

After trying to setup my site for Google Webmaster Tools I found that my Custom ASP.NET 404 page was not returning the 404 status code. It displayed the correct custom page and told the browser that everything is OK. This is consider a soft 404 or false 404. Google doesn't like this. So I found many articles on the issue but the solution...

Handling custom errors with a port in the URL for IIS

I am trying to specify a custom (ASPX) page to handle 404 errors. I can't seem to do this with IIS because I use a port other than the default. I have two versions of my site, one exposed (default port) and one on another port, for testing. I'm trying to do this in testing mode first. If I do: http://www.mysite.com/notapage ... I get ...

How to display Custom error message on asp.net compilation errors

I have configured my web.config to show 'error.htm' error page when exceptions occur on the website. But I am unable to show the page when an asp.net compilation error occurs. How do I make that happen. Im running on IIS 7. ...

How to clear inherited customErrors elements in Web.config?

As the article ASP.NET Configuration File Hierarchy and Inheritance says the Web.config file for a specific Web site contains settings that apply to the Web site and inherit downward through all of the ASP.NET applications and subdirectories of the site. I have these settings for a "parent" application <customErrors mod...

Why is HttpContext.Session null when redirectMode = ResponseRewrite

As is suggested elsewhere, I am using redirectMode = ResponseRewrite in my custom error configuration so my custom error page can access the exception info. This has worked like a charm for some time. In adding some more "help the user recover from an error" type functionality, we need a piece of info that has been previously stored in...

How do I get the member to which my custom attribute was applied?

I'm creating a custom attribute in C# and I want to do different things based on whether the attribute is applied to a method versus a property. At first I was going to do new StackTrace().GetFrame(1).GetMethod() in my custom attribute constructor to see what method called the attribute constructor, but now I'm unsure what that will giv...

Apache's ErrorDocument directive for asp/IIS ?

now i saw a very good php script and i rewrite it to asp the script here:Fantastic Animation PHP/CSS/jQuery Error pages but know iam in big problem how i can use .htaccess in asp see how it work ErrorDocument 500 /error.php?code=500 can i use .htaccess in asp please tell me because iam newbie in it because know i convery error.php to ...

Java: custom-exception-error

$ javac TestExceptions.java TestExceptions.java:11: cannot find symbol symbol : class test location: class TestExceptions throw new TestExceptions.test("If you see me, exceptions work!"); ^ 1 error Code import java.util.*; import java.io.*; public class TestExceptions { static voi...

WINAPI SetLastError versus C++ Keword Throw

What is the difference between the WINAPI SetLastError() and the C++ keyword throw? For example, are SetLastError(5); and throw 5; the same? ...