'〜/ Areas/SomeArea/Views/List/Index.cshtml'中的視圖必須來自ViewPage,ViewPage,ViewUserControl或ViewUserControl。 項目結構幾乎是默認的。有一個地區叫SomeArea。它有一個名爲List的單個控制器。它什麼都不做,除了: public ActionResult Index()
{
return V
型號 public class PdfPage
{
public IEnumerable<PdfPhoto> Photos { get; set; }
}
public class PdfPhoto
{
public string path { get; set; }
}
查看 <ul>
<li>
<%= Html.Hidden("ListP
所以,我個人認爲這有點怪。 我把.aspx模板放在一個非標準的位置。在這個例子中,它有一個虛擬路徑~/Content/Sites/magical/Index.aspx。 然後我創建了自己的視圖引擎作爲測試,延伸WebFormsViewEngine:
public class MagicalWebFormsViewEngine : WebFormViewEngine
{
publi