I am learning controller rendering in Sitecore from here .
I created one simple controller (HelloWorld) and a related view (Index.schtml). He matched it (with the name PageContent) in the rendering section of the Sitecore Explorer ... and adds the rendering element to the "Home item in the content section of the Sitecore browser" section. But when I look at it, it gives an error.
The controller for path '/' was not found or does not implement IController.
All the posts I read relate to Asp.Net MVC .. but I have a problem related to Sitecore MVC
Sample.html (Content of the page in the rendering section of the Sitecore Explorer)
@using Sitecore.Mvc <html> <body> @Html.Sitecore().Placeholder("content") <p>Today date is @DateTime.Now.ToShortDateString()</p> </body> </html>
Only this line poses a problem
@Html.Sitecore().Placeholder("content")
If I delete this line ... This works fine, and the page in the browser shows the date and time
Index.html
<p>Hello from Controller -todays Date is @DateTime.Now.ToString()</p>
controller
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace MVC.Controllers { public class HelloWorldController : Controller {
source share