mishrsud / mvc-mini-profiler

Automatically exported from code.google.com/p/mvc-mini-profiler
0 stars 0 forks source link

WebForms <head runat="server"> causes problems in databind mode #35

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you have a WebForms page that dynamically adds to the control collection in 
the <head> you can't use a literal <%= %> to include the 
MvcMiniProfiler.MiniProfiler.RenderIncludes() call.

Instead you need to use a data binding <%# %>.

If you do this the profiler results appear inline at the bottom of the page - 
it looks like their styles fail to load.

Looking at the rendered HTML I'm expecting:
 <style type="text/css" media="screen" id="less:tfs-mini-profiler-includes">...

Instead I get:
 <style type="text/css" media="screen" id="less:error-message">...

While it has the less error message styles it doesn't show an error from less.

I would expect <%# MvcMiniProfiler.MiniProfiler.RenderIncludes() %> to work.

Note that if you use any of the Microsoft AJAX WebForms components they always 
try to dynamically add to the <head runat="server"> as a control collection, 
and so always throw an exception if there are any literal <%= or <%: in it.

Original issue reported on code.google.com by keithhe...@gmail.com on 22 Jun 2011 at 12:32

GoogleCodeExporter commented 8 years ago
On a different build I was able to get the error message from Less:

variable @anchorColor is undefined
http://.../mini-profiler-includes.less on line 45, column 15:

44        cursor:pointer;
45        color:@anchorColor;
46    }

However @anchorColor is defined, but it is the first Less variable called - my 
guess is that's something going wrong with Less

Original comment by keithhe...@gmail.com on 22 Jun 2011 at 3:25

GoogleCodeExporter commented 8 years ago
Never mind, that wasn't the issue. My mistake :-S

There appears to be a conflict between less.js and prototype-1.5.1.2.js - a 
legacy version still used on our WebForms pages.

Original comment by keithhe...@gmail.com on 22 Jun 2011 at 3:37

GoogleCodeExporter commented 8 years ago
You can put the RenderIncludes() call in a PlaceHolder like this:

<head runat="server">
<asp:PlaceHolder runat="server">
  <%= MvcMiniProfiler.MiniProfiler.RenderIncludes() %>
</asp:PlaceHolder>
</head>

Original comment by lape...@gmail.com on 30 Jun 2011 at 8:25

GoogleCodeExporter commented 8 years ago
old topic, less is now compiled server side .. fixed

Original comment by sam.saff...@gmail.com on 15 Aug 2011 at 1:09