When I installed ASP.NET MVC RC2, I noticed that the template had changed from RC1. Now, all new views have the header placeholder after the main content place holder. Why is this? It seems very illogical to me and it most definitely was not the case with RC1. I googled but couldn't find any reasoning for this change. Do you know of any?
Example:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<h2>Rules</h2>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
Note how the placeholder with ContentPlaceHolderID of "head" is at the bottom? Weird...
-
I can't say I noticed it when I upgraded, but it shouldn't matter. The two
<asp:Content>
sections get mapped by theID
property to their places as defined inSite.master
.Definitely check the order in
Site.master
, but it should be fine.If you want to change this, you can look into the T4 template your views are using. Check out:
http://haacked.com/archive/2009/01/31/t4-templates-in-asp.net-mvc.aspx
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.