ビュー「Whatever」またはそのマスターが見つかりませんでした。ASP.NETMVCビュー「name」またはそのマスターが見つかりませんでしたが、問題の解決策が見つかりません。ファイルはディレクトリに存在しますが、存在しないと表示されます。
ビュー'GetLastArticle'またはそのマスターが見つからなかったか、検索された場所をサポートするビューエンジンがありません。次の場所が検索されました:〜/ Views / Article / GetLastArticle.aspx〜/ Views / Article / GetLastArticle.ascx〜/ Views / Shared / GetLastArticle.aspx〜/ Views / Shared / GetLastArticle.ascx〜/ Views / Article/GetLastArticle。 cshtml〜/ Views / Article / GetLastArticle.vbhtml〜/ Views / Shared / GetLastArticle.cshtml〜/ Views / Shared / GetLastArticle.vbhtml
これは、次のコードのこの行を指しています。
@Html.Action("GetLastArticle", "Article")
@Code
ViewData("Title") = "Home Page"
End Code
<h2>My Blog <span>news</span></h2>
<div class="info_box_holder fltleft">
@Html.Action("GetLastRssItem", "Rss", New With {.url = "http://rss.ew.com/web/ew/rss/todayslatest/index.xml"})
@Html.Action("GetLastRssItem", "Rss", New With {.url = "http://www.eonline.com/syndication/feeds/rssfeeds/movies.xml"})
</div>
<div class="info_box_holder fltleft">
@Html.Action("GetLastArticle", "Article")
@Html.Action("GetLastRssItem", "Rss", New With {.url = "http://rss.news.yahoo.com/rss/entertainment"})
</div>
これが私が呼び出している私のアクションであり、エラーが発生します:
Function GetLastArticle() As ActionResult
Dim models = db.Articles.OrderByDescending(Function(a) a.DateCreated)
Dim model = New Article
If models.Any Then
model = db.Articles.OrderByDescending(Function(a) a.DateCreated).First
Else
model.DateCreated = Date.Today
model.Title = "Latest article not found"
model.Body = "The latest article was not found."
End If
Return View(model)
End Function
このサイトはローカルホストで正常に動作しますが、公開するとエラーが発生します。どうすればこれを修正できますか?