Miniprofiler为ASP.NET网站 [英] Miniprofiler for ASP.NET web site

查看:161
本文介绍了Miniprofiler为ASP.NET网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆