Created
November 18, 2011 20:29
-
-
Save irobinson/1377662 to your computer and use it in GitHub Desktop.
Positioning of various elements in the DOM in DNN 6.1.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!-- New API CSS (e.g. ClientResourceManager.RegisterStyleSheet) --> | |
<asp:PlaceHolder runat="server" ID="ClientDependencyHeadCss"></asp:PlaceHolder> | |
<!-- New API JS (e.g. ClientResourceManager.RegisterScript)--> | |
<asp:PlaceHolder runat="server" ID="ClientDependencyHeadJs"></asp:PlaceHolder> | |
<!-- "Old API" CSS (e.g. styles skin object)--> | |
<asp:placeholder id="CSS" runat="server" /> | |
<!-- "Old API" JS (not sure if anything still uses this) --> | |
<asp:placeholder id="SCRIPTS" runat="server" /> | |
</head> | |
<body> | |
<form> <!-- ASP.NET stuff gets dynamically prepended to the form, so it goes before our explicit placeholder. --> | |
<!-- new API JS "top of the form" location. explicit placeholder. first thing inside form. --> | |
<asp:PlaceHolder ID="BodySCRIPTS" runat="server" /> | |
[....skin and everything inside it goes here...] | |
<!-- two old school DNN variables --> | |
<input id="ScrollTop" runat="server" name="ScrollTop" type="hidden" /> | |
<input id="__dnnVariable" runat="server" name="__dnnVariable" type="hidden" /> | |
<!-- the last location for the New API, for stuff that needs to load at the bottom --> | |
<asp:placeholder runat="server" ID="ClientResourcesFormBottom" /> | |
<form> | |
</body> | |
</html> |
Additionally, there is an issue where things that use the ASP.NET JS registration methods are dynamically prepended to the form body, this creates a situation where library/utility methods can be registered (in BodySCRIPTS) and the JS that consumes them can be loaded before. Hmmmm....
But, keeping in mind that file combination is done on a "per-location" basis, and we already have three locations. Should we really break it down even further?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now framework level files (jQuery and jQuery UI) are loaded in the head, to ensure that everything in the body, no matter where, can use them. However, we may want to examine other resources to see if they qualify as "framework level" - like the new jQuery plugins should also be loaded in the head perhaps?