Reputation: 6101
There are a lot of buttons in my web form (asp.net), want to know following things:
I want all in at the time of development, means i don't want to deploy project some where and then check it from fiddler kind of tool. There must be some thing in VS2008 asp.net from where we can get how much time a particular action takes.
Upvotes: 1
Views: 179
Reputation: 619
Turn on tracing
You can turn on tracing on a single page using the Trace attribute in the Page directive.
<%@ Page Trace="true" %>
You can also turn on tracing for all pages in an asp.net application using the web.config setting.
<configuration>
<system.web>
<trace enabled="true" pageOutput="false" requestLimit="40" localOnly="false"/>
</system.web>
</configuration>
Add custom output to the trace output.
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Trace.Write("custom start");
System.Threading.Thread.Sleep(2000);
Trace.Write("custom end");
}
}
The above code shows up like this
Upvotes: 1
Reputation: 40726
For me, what work best in the past is to use a performance profiler.
I've tried various tools and ended with buying Red Gate's ANTS Performance Profiler. They have a 14 days free trial, so you can actually see whether you have a benefit from using the tool.
I experiences that I was wrong most of the time when assuming the cause of a performance bottleneck in contrast to actually measuring it.
Upvotes: 0