3
votes

I'm running into an issue where it seems that Controller Renderings are not being rendered by our install of Sitecore 9. This is on a fresh install of 9. I've gone through tutorials on various sites stepping through the creation of Controller Renderings (in hopes I was doing something wrong), have fiddled around with the Controller name (include just the name, do the whole namespace, do the whole namespace with the assembly after it, etc). I've tried making the Controller inherit from just Controller, tried making it inherit from SitecoreController. I've tried without a view (returning just Content) and with a view. No luck.

What's more, I get no error, which I believe is unexpected. I can put anything I want into the Controller name, any string of garbage text, include this as a control inside a content item placeholder, publish it and I just get a blank screen. I can even revert the site back to where it was before I deployed any development code out to it, in essence returning it to the site provided by SIF and I get no error with my garbage controller rendering.

Has anyone experienced issues with Sitecore 9 and Controller Renderings? At the least, I was assuming I'd at least get thrown some error if I was setting up the rendering wrong.

Any help is appreciated.

Thanks much.

1

1 Answers

3
votes

Well. Nevermind. But here's a great and obvious tip for anyone who comes after me. The SIF website sample layout is a webforms layout. Obviously, you cannot just drop a controller rendering or a view rendering into that. You have to drop it into a razor layout as there's no mixing MVC and webforms.

Didn't see it as the sample layout is not in our development project. But also would have loved to get some kind of error.

Stupid mistake. But maybe it'll help somebody else.