CODEDIGEST
Home » CodeDigest
Search
 

Technologies
 

Displaying Last Request Processed Server Time at the End of Every ASP.Net Pages
Submitted By Satheesh Babu B
On 11/5/2008 7:01:55 AM
Tags: asp.net,CodeDigest  

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

  1. Include a Global.asax file in your project.
  2. 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  

Do you have a working code that can be used by anyone? Submit it here. It may help someone in the community!!

Recent Codes
  • View All Codes..