Try our conversational search powered by Generative AI!

CMS doesn't route through controller but website does


Hi There,

I get the below error when trying to look at any block within the CMS. Everything renders fine in the website though. When I debug it doesn't hit the breakpoint in the controller I have.

Our site uses Alloy as it's base and I have added the block to either the two paths:


The view 'index' or its master was not found or no view engine supports the searched locations. The following locations were searched:

Any Ideas?

Cheers Ben

Feb 03, 2015 7:51

Hi Ben,

How is your block rendered, in a content area or is it a local block? Can you post the code from the controller?


Feb 03, 2015 9:19

So the blocks when displayed within the CMS UI get this issue, when in a ContentArea and as a block that you can drag and drop in to a ContentArea. They display perfectly when rendered on the website though.

The controller code I have tried many different variations to try and get it to work. Within the CMS the controller isn't routed to. Here's my code for the controller

namespace MyCompany.Controllers
	public class MyBlockController : BlockController<MyBlock>
		public override ActionResult Index(MyBlock currentBlock)
			if (currentBlock.FeaturedStyle)
				currentBlock.StyleAddons = "featured";

			currentBlock.ColumnCount = currentBlock.Buttons.IsNotNull() ? currentBlock.Buttons.Count : 0;

			return PartialView("~/Views/MyBlock/Index.cshtml",currentBlock);

Cheers Ben

Feb 03, 2015 23:41

Strange thing is that the MVC view engine tries to search to a path with the 'Preview' value and not your block name 'MyBlock'. Do you have a PreviewController and if you set a breakpoint does it hit?

Does the error occur when you view the whole page in the CMS or only the block?

Feb 04, 2015 9:19

Thanks so much for your response. Your post has helped me solve many hours of trial and error. One of our devs implemented this preview controller and the view (\preview\Index.cshtml) was missing hence this has occured. The solution was staring me in the face the whole time.

Feb 04, 2015 9:46
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.