| 1 | <%@ Application Language="C#" %>
|
|---|
| 2 |
|
|---|
| 3 | <script runat="server">
|
|---|
| 4 |
|
|---|
| 5 | void Application_Start(object sender, EventArgs e)
|
|---|
| 6 | {
|
|---|
| 7 | // Code that runs on application startup
|
|---|
| 8 | }
|
|---|
| 9 |
|
|---|
| 10 | void Application_End(object sender, EventArgs e)
|
|---|
| 11 | {
|
|---|
| 12 | // Code that runs on application shutdown
|
|---|
| 13 | FormsAuthentication.SignOut();
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | void Application_Error(object sender, EventArgs e)
|
|---|
| 17 | {
|
|---|
| 18 | string strErrorMsg = "platnosci.admoto.pl Error\n\n";
|
|---|
| 19 |
|
|---|
| 20 | // Get the path of the page
|
|---|
| 21 | strErrorMsg += "Error in Path :" + Request.Path;
|
|---|
| 22 | // Get the QueryString along with the Virtual Path
|
|---|
| 23 | strErrorMsg += "\n\n Error Raw Url :" + Request.RawUrl;
|
|---|
| 24 | // Create an Exception object from the Last error that occurred on the server
|
|---|
| 25 | Exception myError = Server.GetLastError();
|
|---|
| 26 | // Get the error message
|
|---|
| 27 | strErrorMsg += "\n\nError Message :" + myError.Message;
|
|---|
| 28 | // Source of the message
|
|---|
| 29 | strErrorMsg += "\n\nError Source :" + myError.Source;
|
|---|
| 30 | // Stack Trace of the error
|
|---|
| 31 | strErrorMsg += "\n\nError Stack Trace :" + myError.StackTrace;
|
|---|
| 32 | // Method where the error occurred
|
|---|
| 33 | strErrorMsg += "\n\nError TargetSite :" + myError.TargetSite;
|
|---|
| 34 |
|
|---|
| 35 | // Email Error
|
|---|
| 36 | string strEmail = "centrala@ct.com.pl";
|
|---|
| 37 | SendMail email = new SendMail();
|
|---|
| 38 | email.Wyslij(strEmail, strEmail, "platnosci.admoto.pl Error", strErrorMsg);
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 | }
|
|---|
| 42 |
|
|---|
| 43 | void Session_Start(object sender, EventArgs e)
|
|---|
| 44 | {
|
|---|
| 45 | // Code that runs when a new session is started
|
|---|
| 46 |
|
|---|
| 47 | }
|
|---|
| 48 |
|
|---|
| 49 | void Session_End(object sender, EventArgs e)
|
|---|
| 50 | {
|
|---|
| 51 | // Code that runs when a session ends.
|
|---|
| 52 | // Note: The Session_End event is raised only when the sessionstate mode
|
|---|
| 53 | // is set to InProc in the Web.config file. If session mode is set to StateServer
|
|---|
| 54 | // or SQLServer, the event is not raised.
|
|---|
| 55 |
|
|---|
| 56 | }
|
|---|
| 57 |
|
|---|
| 58 | </script>
|
|---|