24.2.11

global.asax

<%@ Application Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Net.Mail" %>
<%@ Import Namespace="SRMS.Bll" %>
<%@ Import Namespace="SRMS.BO" %>

script runat="server">

void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup

}

void Application_End(object sender, EventArgs e)
{
// Code that runs on application shutdown

}

void Application_Error(object sender, EventArgs e)
{
// Exception err = (Exception)Server.GetLastError().InnerException;
//Log the error details

//string errorText = "

Error Message:" +
// err.Message.ToString() +
// "

Stack Trace: " +
// err.StackTrace.ToString() +
// "

" +
// "

Error in: " +
// Request.Url.ToString() +
// "

" + "

Location ID(Location Name) is: " + Session["Session:LocationID"] + "(" + Session["Session:LocationName"] + ")" + "

";

//MailMessage message = new MailMessage();
//message.From = new MailAddress("post@gmailcom");
//message.To.Add(new MailAddress("x@gmail.com"));
//message.CC.Add(new MailAddress("p@gmail.com"));
//message.Subject = "U Error Detail";
//message.Body = errorText;
//message.IsBodyHtml = true;

//SmtpClient client = new SmtpClient("smtp.u.com");
//client.Credentials = new System.Net.NetworkCredential("post@.com", "Tony1234");
//try
//{
//client.Send(message);
//}
//catch (Exception ex)
//{
// ex.Message.ToString();
//}
}

void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started

}

void Session_End(object sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.

}

No comments: