Displaying Last Request Processed Server Time at the End of Every Page in ASP.Net
We can display the server time when the page was last processed at the end of every pages through Global.asax file. For example, aspalliance.com displays last Page Processed time at the end of every pages. This small code snippet will help us doing the same in our ASP.Net sites.
Steps
- Include a Global.asax file in your project.
- Do a Response.Write of DateTime.Now in Application_EndRequest event. By default, there will be no Application_EndRequest event we need to include it explicitly!
protected void Application_EndRequest(Object sender, EventArgs e)
{
Context.Response.Write("<b>Page Processed at " + DateTime.Now.ToString());
}
This will append the "Page Processed at 11/2/2008 8:32:06 AM" at the end of every HTML output which makes it to display at end of every page.
Reference
Read my article on Display Request Processing Time in ASP.Net pages
|