MVC的视图搜索顺序
为了说明问题,我构建了两个视图,Hello.aspx,Hello.chtml,如下图所示:
其中Hello.aspx的代码如下:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %> "http://www.w3.org/1999/xhtml"> "server"> "Content-Type" content="text/html; charset=utf-8"/>
运行的结果如下:
事实证明,即使是Razor,aspx的优先级是高于chtml。可以说是一个BUG吧,改得不彻底!
原文:https://www.cnblogs.com/chengk/p/14883741.html