<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> <#@ Output extension="aspx" #> <# var viewDataType = (EnvDTE.CodeType) Model.ViewDataType; #> <# string mvcViewDataTypeGenericString = (viewDataType != null) ? "<" + viewDataType.FullName + ">" : ""; int CPHCounter = 1; #> <# if(Model.IsContentPage) { #> <%@ Page Title="" Language="C#" MasterPageFile="~<#= Model.Layout #>" Inherits="System.Web.Mvc.ViewPage<#= mvcViewDataTypeGenericString #>" %> <# foreach(string cphid in Model.SectionNames) { if(cphid.Equals("TitleContent", StringComparison.OrdinalIgnoreCase)) { #> <#= Model.ViewName #> <# CPHCounter++; } } #>

<#= Model.ViewName #>

<# } else { #> <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<#= mvcViewDataTypeGenericString #>" %> <#= Model.ViewName #> <# PushIndent(" "); } #> <# if(!Model.IsContentPage) { #>
<# } #> <# // The following code closes the asp:Content tag used in the case of a master page and the body and html tags in the case of a regular view page #> <# if(Model.IsContentPage) { #>
<# foreach(string cphid in Model.SectionNames) { if(!cphid.Equals("TitleContent", StringComparison.OrdinalIgnoreCase) && !cphid.Equals(Model.PrimarySectionName, StringComparison.OrdinalIgnoreCase)) { CPHCounter++; #> <# } } #> <# } else if(!Model.IsContentPage) { ClearIndent(); #> <# } #>