Guest User

Untitled

a guest
May 23rd, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. void Application_Error(object sender, EventArgs e)
  2. {
  3. //get reference to the source of the exception chain
  4. Exception ex = Server.GetLastError().GetBaseException();
  5. //log the details of the exception and page state to the
  6. //Windows 2000 Event Log
  7. GUI.MailClass objMail = new GUI.MailClass();
  8. string strError = "MESSAGE: " + ex.Message + "<br><br><br>" + "SOURCE: " + ex.Source + "<br>FORM: " + Request.Form.ToString() + "<br>QUERYSTRING: " + Request.QueryString.ToString() + "<br>TARGETSITE: " + ex.TargetSite + "<br>STACKTRACE: " + ex.StackTrace;
  9. if (System.Web.HttpContext.Current.Session["trCustomerEmail"] != null)
  10. {
  11. strError = "Customer Email : " + Session["trCustomerEmail"].ToString() +"<br />"+ strError;
  12. }
  13. //Call a method to send the error details as an Email
  14. objMail.sendMail("test@gmail.com", "myid@gmail.com", "Error in " + Request.Form.ToString(), strError, 2);
  15.  
  16. strError = System.Web.HttpContext.Current.Session["trCustomerEmail"]
  17.  
  18. if (HttpContext.Current != null &&
  19. HttpContext.Current.Session != null) {
  20. strError = HttpContext.Current.Session["trCustomerEmail"]
  21. }
  22.  
  23. HttpContext context = ((HttpApplication)sender).Context;
  24.  
  25. context.Request.QueryString.ToString()
  26. context.Session["key"] = "fasfaasf";
Add Comment
Please, Sign In to add comment