Miniprofiler为ASP.NET网站 [英] Miniprofiler for ASP.NET web site
问题描述
如何使用asp.net网站miniprofiler(NOT FOR MVC)?
有MVC的很多资源,但我找不到网站什么。
感谢亚历克斯。现在,它适用于asp.net网站。但我不明白是什么显示。
我没有写在任何方法code。见下面的图片。
code是作为下面,我跑了探查。
保护无效的Page_Load(对象发件人,EventArgs的发送)
{
使用(MiniProfiler.Current.Step(测试))
{
Page.Title =12345;
}
}
从 miniprofiler.com :
PM>安装封装MiniProfiler
块引用>在
的Global.asax
:使用StackExchange.Profiling;
...
保护无效的Application_BeginRequest()
{
如果(Request.IsLocal)
{
MiniProfiler.Start();
}
}保护无效Application_EndRequest()
{
MiniProfiler.Stop();
}然后在某处你的母版页:
<%= StackExchange.Profiling.MiniProfiler.RenderIncludes()%GT;
这应该启动是不够的。
How can I use miniprofiler in asp.net web site(NOT FOR MVC)? There are many resources for MVC but I can not find anything for web site.
Thanks to Alex. Now it works for asp.net web site. But I can not understand what it displays. I have not written any code in method. See the image below.
Code is as below for which I ran profiler.
protected void Page_Load(object sender, EventArgs e) { using (MiniProfiler.Current.Step("test")) { Page.Title = "12345"; } }
解决方案From the miniprofiler.com:
PM> Install-Package MiniProfiler
in your
global.asax
:using StackExchange.Profiling; ... protected void Application_BeginRequest() { if (Request.IsLocal) { MiniProfiler.Start(); } } protected void Application_EndRequest() { MiniProfiler.Stop(); }
and then somewhere in your master page:
<%= StackExchange.Profiling.MiniProfiler.RenderIncludes() %>
This should be enough for starting.
这篇关于Miniprofiler为ASP.NET网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!