I'm trying to get MVC-mini-profiler to work with webforms.
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
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();
Result
It renders a <div class="profiler-results left"></div>
tag on my page, but it is empty.
If I look at the chrome console I see a 404 trying to find: http://example.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?
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.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With