Click here to Skip to main content
15,903,854 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionGetting Parser error when running Web Application on Internet Pin
GauravKP8-Sep-09 2:58
professionalGauravKP8-Sep-09 2:58 
AnswerRe: Getting Parser error when running Web Application on Internet Pin
SeMartens8-Sep-09 3:49
SeMartens8-Sep-09 3:49 
Questionsession variable Pin
Abbas_here8-Sep-09 2:49
Abbas_here8-Sep-09 2:49 
Answer[Message Deleted] Pin
GauravKP8-Sep-09 2:59
professionalGauravKP8-Sep-09 2:59 
GeneralRe: session variable Pin
Abhijit Jana8-Sep-09 3:02
professionalAbhijit Jana8-Sep-09 3:02 
GeneralRe: session variable Pin
Abbas_here8-Sep-09 3:02
Abbas_here8-Sep-09 3:02 
GeneralASP.NET page generation Pin
ankit_sam8-Sep-09 2:48
ankit_sam8-Sep-09 2:48 
GeneralRe: ASP.NET page generation Pin
Abhishek Sur8-Sep-09 13:08
professionalAbhishek Sur8-Sep-09 13:08 
Just define a HttpModule,

public class TimingModule : IHttpModule {

  public void Init(HttpApplication context) {
    context.BeginRequest += OnBeginRequest;
    context.EndRequest += OnEndRequest;
  }

  void OnBeginRequest(object sender, System.EventArgs e) {
    if (HttpContext.Current.Request.IsLocal) {
      var stopwatch = new Stopwatch();
      HttpContext.Current.Items["Stopwatch"] = stopwatch;
      stopwatch.Start();
    }
  }

  void OnEndRequest(object sender, System.EventArgs e) {
    if (HttpContext.Current.Request.IsLocal) {
      Stopwatch stopwatch = 
        (Stopwatch)HttpContext.Current.Items["Stopwatch"];
      stopwatch.Stop();

      TimeSpan ts = stopwatch.Elapsed;
      string elapsedTime = String.Format("Generated in {0}ms", ts.TotalMilliseconds);

      HttpContext.Current.Response.Write("<p>" + elapsedTime + "</p>");
    }
  }
}


Then add:


<httpModules>>
  <add name="TimingModule" type="TimingModule" />
</httpModules>


Each page will have "Generated in (0)ms" at the bottom.Cool | :cool:

Abhishek Sur

My Latest Articles
Create CLR objects in SQL Server 2005
C# Uncommon Keywords
Read/Write Excel using OleDB

Don't forget to click "Good Answer" if you like to.

Questionproblem with primary key Pin
shankbond8-Sep-09 2:01
shankbond8-Sep-09 2:01 
AnswerRe: problem with primary key Pin
Manas Bhardwaj8-Sep-09 2:13
professionalManas Bhardwaj8-Sep-09 2:13 
AnswerRe: problem with primary key Pin
Aman Bhullar8-Sep-09 2:17
Aman Bhullar8-Sep-09 2:17 
GeneralAgree scope_identity() is the way to go. Read this article Pin
David Mujica8-Sep-09 2:51
David Mujica8-Sep-09 2:51 
AnswerRe: problem with primary key Pin
Zoki Manas8-Sep-09 22:38
Zoki Manas8-Sep-09 22:38 
GeneralRe: problem with primary key Pin
shankbond8-Sep-09 23:43
shankbond8-Sep-09 23:43 
GeneralRe: problem with primary key Pin
Aman Bhullar9-Sep-09 5:14
Aman Bhullar9-Sep-09 5:14 
Questiontreeview with context menu Pin
rinku soni 238-Sep-09 1:56
rinku soni 238-Sep-09 1:56 
AnswerRe: treeview with context menu Pin
GauravKP8-Sep-09 3:24
professionalGauravKP8-Sep-09 3:24 
QuestionASP.net web administrator tool error Pin
Hum Dum8-Sep-09 1:48
Hum Dum8-Sep-09 1:48 
AnswerRe: ASP.net web administrator tool error Pin
janani138-Sep-09 2:38
janani138-Sep-09 2:38 
GeneralRe: ASP.net web administrator tool error Pin
Hum Dum8-Sep-09 19:30
Hum Dum8-Sep-09 19:30 
AnswerRe: ASP.net web administrator tool error Pin
sashidhar8-Sep-09 23:46
sashidhar8-Sep-09 23:46 
Questiondynamic control Pin
mylogics8-Sep-09 1:44
professionalmylogics8-Sep-09 1:44 
AnswerRe: dynamic control Pin
Manas Bhardwaj8-Sep-09 1:56
professionalManas Bhardwaj8-Sep-09 1:56 
AnswerRe: dynamic control Pin
Abhishek Sur8-Sep-09 2:04
professionalAbhishek Sur8-Sep-09 2:04 
AnswerRe: dynamic control Pin
Abhijit Jana8-Sep-09 2:17
professionalAbhijit Jana8-Sep-09 2:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.