Diff between <head id="Head1" runat="server"> and <asp:ContentPlaceHolder runat="server" ID="HeadCon
Posted
by justSteve
on Stack Overflow
See other posts from Stack Overflow
or by justSteve
Published on 2010-05-17T13:57:04Z
Indexed on
2010/05/17
14:00 UTC
Read the original article
Hit count: 613
asp.net-mvc-2
|ASP.NET
Looking for an better understanding of how an mvc project should define javascript and css includes. I'm working with sample code where includes are defined like:
<head id="Head1" runat="server">
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" />Affiliate Checkout</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="pragma" content="no-cache">
<script type="text/javascript" src="/Scripts/jquery.js"></script>
<script type="text/javascript" src="/Scripts/jquery-ui-1.7.2.custom.min.js"></script>
.
.
.
<asp:ContentPlaceHolder runat="server" ID="HeadContent"></asp:ContentPlaceHolder>
</head>
I'm reading that to be that _all pages looking at this MasterPage will get jquery and jqueryUI and, additionally, each page will have the opportunity to add head elements thankx to the content placeholder HeadContent tag.
The specific problem i'm troubleshooting is an instance where my rendered page is not including the 'prama no-cache' tag - as you see, it's defined in the upper level header section. Other .js and .css elements are making it into the rendered page so it very confusing to see that the no-cache tag isn't.
When execute a 'View Generated Source' - the 'charset' is present the 'no-cache' is not.
© Stack Overflow or respective owner