asp.net – MVC-Mini-Profiler – Web窗体 – 找不到/ mini-prof
发布时间:2020-12-16 00:25:57 所属栏目:asp.Net 来源:网络整理
导读:我试图让MVC-mini-profiler与webforms一起工作。 的NuGet 我已经安装了Nuget软件包。 PM Install-Package MiniProfiler 头 我在网站的头部有这个。 script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"/
我试图让MVC-mini-profiler与webforms一起工作。
的NuGet PM> Install-Package MiniProfiler 头 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <%= MvcMiniProfiler.MiniProfiler.RenderIncludes() %> DAL profiler = MiniProfiler.Start(); using (profiler.Step("Im doing stuff")) { //do stuff here } MvcMiniProfiler.MiniProfiler.Stop(); 结果 如果我看着chrome控制台,我看到一个404试图找到:http://example.com/mini-profiler-results?id=339d84a7-3898-429f-974b-64038462d59a&popup=1 题 回答 解决方法
在安装NuGet软件包之后,以下页面对我来说非常棒:
<%@ Page Language="C#" %> <%@ Import Namespace="MvcMiniProfiler" %> <%@ Import Namespace="System.Threading" %> <script type="text/c#" runat="server"> protected void Page_Load(object sender,EventArgs e) { MiniProfiler.Start(); using (MiniProfiler.Current.Step("I'm doing stuff")) { Thread.Sleep(300); } MiniProfiler.Stop(); } </script> <!DOCTYPE html> <html> <head runat="server"> <title></title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <%= MiniProfiler.RenderIncludes() %> </head> <body> <form id="Form1" runat="server"> <div>Hello World</div> </form> </body> </html> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – 集合的Asp MVC3自定义EditorTemplate(空或不)
- 用于诊断.NET中的内存泄漏的工具(ASP.NET应用程序)
- razor – 如何定义在asp.net核心中返回html的函数
- asp.net-mvc – 在MVC3 Razor视图引擎中设置文本框的可见性
- asp.net – 删除一些ListItem后,在GridView中的DropDownLis
- asp.net-mvc – MVC验证消息 – 本地化?
- ASP.NET MVC3 TryValidateModel验证整个模型集合,而不仅仅是
- asp.net-mvc-3 – ASP.NET MVC 3编辑器模板中的IEnumerable
- asp.net-mvc-4 – ASP.NET 4.5和Web API中的URL重写
- asp.net-mvc – 使用PreCompiled网站运行自定义VirtualPath