You can configure a custom error page in the web.config as follows:
<configuration>
<system.web>
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly">
</customErrors>
</system.web>
</configuration>
It is also wise to log those exceptions. There are several populair logging frameworks who can do this for you. Two of them, ELMAH and CuttingEdge.Logging, have standard integration facilities for ASP.NET, which allows to to write no single line of code. Using CuttingEdge.Logging for instance, you can configure your site to automatically log errors to the Windows event log as follows:
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="logging"
type="CuttingEdge.Logging.LoggingSection, CuttingEdge.Logging" />
</configSections>
<logging defaultProvider="WindowsEventLogger">
<providers>
<add name="WindowsEventLogger"
type="CuttingEdge.Logging.WindowsEventLogLoggingProvider, CuttingEdge.Logging"
source="MyWebApplication"
logName="MyWebApplication" />
</providers>
</logging>
<system.web>
<httpModules>
<add name="ExceptionLogger"
type="CuttingEdge.Logging.Web.AspNetExceptionLoggingModule, CuttingEdge.Logging"/>
</httpModules>
</system.web>
</configuration>
Update: Sorry, reading questions seems hard for me. You want to send the exception to your ticketing systems. All popular logging systems allow you to extend the default functionality, often quite easily, but of course you will need to code for this. You can of course also override the
Application_Error
as Philip suggests. However, those logging frameworks might have a lot of functionality you might want to consider.
Good luck.