MVC-迷你探查 - Web窗体 - 无法找到/迷你探查,结果 [英] MVC-Mini-Profiler - Web Forms - Can't find /mini-profiler-results
问题描述
我试图让MVC-迷你探查与web表单的工作。
I'm trying to get MVC-mini-profiler to work with webforms.
的NuGet 结果
我已经安装了的NuGet包。
NUGET
I've installed the Nuget package.
PM> Install-Package MiniProfiler
头结果
我有这个在我的网站的头部分。
Head
I have this in the head section of my website.
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<%= MvcMiniProfiler.MiniProfiler.RenderIncludes() %>
DAL 结果
我使用的是一个功能作为POC内。这不是在Global.asax(我不如果是这样的要求或不知道。)
DAL
I'm using it inside one function as a POC. This is not in the Global.asax (I dont know if that's required or not.)
profiler = MiniProfiler.Start();
using (profiler.Step("Im doing stuff"))
{
//do stuff here
}
MvcMiniProfiler.MiniProfiler.Stop();
结果结果
它呈现一个&LT; DIV CLASS =探查,结果却让&GT;&LT; / DIV&GT;
我的网页上的标签,但它是空的。
Result
It renders a <div class="profiler-results left"></div>
tag on my page, but it is empty.
如果我看着铬控制台我看到一个404试图找到:<一href=\"http://mysite.com/mini-profiler-results?id=339d84a7-3898-429f-974b-64038462d59a&popup=1\">http://mysite.com/mini-profiler-results?id=339d84a7-3898-429f-974b-64038462d59a&popup=1
If I look at the chrome console I see a 404 trying to find: http://mysite.com/mini-profiler-results?id=339d84a7-3898-429f-974b-64038462d59a&popup=1
问结果
我缺少的一个步骤,以获得/迷你探查,结果链接的工作?
Question
Am I missing a step to get the /mini-profiler-results link to work?
答结果
我标记为答案的反应使我觉得这没有什么与我的配置做的(这是真的)。我使用一把umbraco 4.7.0。我不得不添加〜/迷你探查,结果来umbracoReservedUrls和umbracoReservedPaths在我的web.config。
Answer
The response I marked as answer led me to think that it had nothing to do with my configuration (which is true). I am using Umbraco 4.7.0. I had to add "~/mini-profiler-results" to umbracoReservedUrls and umbracoReservedPaths in my web.config.
推荐答案
以下页面的工作只是伟大的我安装的NuGet包后:
The following page worked just great for me after installing the NuGet package:
<%@ 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>
这篇关于MVC-迷你探查 - Web窗体 - 无法找到/迷你探查,结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!