Closed GoogleCodeExporter closed 9 years ago
In the applications that are using Mini Profiler we alter the controls with in
the head tag and this results in the error you have.
What I have done (this has been working for my applications in production no
problem) is wrap the call in a placeholder control.
<asp:PlaceHolder runat="server">
<%= MvcMiniProfiler.MiniProfiler.RenderIncludes() %>
</asp:PlaceHolder>
My understanding is that the method RenderIncludes() outputs HTML to the page
and does not alter the control collection. As soon as the controls within the
head tag are altered it throws an error because the html renders is not part of
a control. Wrapping it in a control solves this issue.
I am not sure what the menu control is doing that it is altering the head
control but I am sure if you check what it renders you will find something that
is altered in the head tag.
Hope this helps
Original comment by MHB...@gmail.com
on 10 Jan 2012 at 9:51
You can also change
<%= MvcMiniProfiler.MiniProfiler.RenderIncludes() %>
to be
<%# MvcMiniProfiler.MiniProfiler.RenderIncludes() %>
and then in Site.Master.cs make a call to Page.Header.DataBind() like so:
protected void Page_Load(object sender, EventArgs e)
{
Page.Header.DataBind();
}
Original comment by admi...@gmail.com
on 19 Mar 2012 at 10:12
The current best practice with MiniProfiler 2.0 is to do the render includes
"just before" closing the <BODY> tag
Original comment by sam.saff...@gmail.com
on 3 Apr 2012 at 4:25
Original issue reported on code.google.com by
brnv...@gmail.com
on 12 Oct 2011 at 2:14