我正在學習Sitecore中的控制器呈現從Here。路徑'/'的控制器未找到或未在Sitecore中實現IController
我創建了一個簡單的控制器(HelloWorld)和相關視圖(Index.schtml)。在Sitecore資源管理器的呈現部分中將其映射(具有名稱PageContent)...並在Sitecore資源管理器的內容部分中的主項目中添加呈現項目。但是,當我瀏覽它時,它會給出錯誤。
The controller for path '/' was not found or does not implement IController.
所有的帖子我看了都涉及到的ASP.NET MVC ..但我有問題,涉及到Sitecore的MVC
Sample.html(在Sitecore的瀏覽器呈現部分頁面內容)
@using Sitecore.Mvc
<html>
<body>
@Html.Sitecore().Placeholder("content")
<p>Today's date is @DateTime.Now.ToShortDateString()</p>
</body>
</html>
僅此行是給問題
@Html.Sitecore().Placeholder("content")
如果我刪除此行......它工作正常的在瀏覽器顯示的日期和時間
的Index.html
<p>Hello from Controller -todays Date is @DateTime.Now.ToString()</p>
控制器d頁
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MVC.Controllers
{
public class HelloWorldController : Controller
{
//
// GET: /HellowWorld/
public ActionResult Index()
{
return View();
}
}
}
這裏發生了什麼是微軟的一些安全更新調升MVC 3的版本3.0.0.1 。該網站綁定到3.0.0.1,但我使用的編譯庫仍然綁定到3.0.0.0,他們無法理解我的控制器。 – Juliano 2015-05-20 14:39:45
「只用控制器名稱。」 - 每次都能得到我! – 2016-01-08 18:29:23
@gerzson該死的,downvote是完全不自願的,一些標籤洗牌後錯誤地點擊,抱歉... – Wasp 2017-03-16 15:37:47