Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,I'm tryin gmy first test project with Umbraco 4.11.9 and MVC 4. I have create the Umbraco site and database all working well. Then created a new MVC 4 project and added a controller as shown below
public class DemoSurfaceController : Umbraco.Web.Mvc.SurfaceController
// // GET: /Demo/
public ActionResult Index()
and added a view
ViewBag.Title = "Index";
This is our own Demo controller and View.
When running the site it never its the break point in the controller. What have I missed here with regads to routing which I assumed was automatic. I tried adding a documenttype call demo and associatyed template but nothing.The url is was using is http://localhost:/DemoAll I get is a blank page, if I use a RenderMvcController I can get it to work but its not what I want. Any help apprciated this is my first week with Umbraco MVCThanksKen
Have you changed the template engine in /config/umbracoSettings.config to MVC? By default it's webforms.
Yes first thing I did was change the config to <defaultRenderingEngine>MVC</defaultRenderingEngine>.
As I said if I use RenderMvcController instead of SurfaceController I can get it toi hit the breakpoint so the routing works.
I just can seem to get it to work with the code above and can't seem to find a good whole example that I can look at to see where I'm going wrong.
Ok managed to get the routing working now but get a different error
Attempt by method 'Login' to access method 'System.Web.Mvc.Controller.PartialView(System.String, System.Object)' failed.
One step at a time
You should call your sufarce controller action from a view with @Html.Action
Yep done that this is my front page view
Layout = null;
I think the problem is that you don't specify a view for action in your controller :
Can you try this :
Well it looks like the issue was my project being MVC 4 and not MVC 3. If I use MVC 3 it all works fine if I use MVC 4 I get errors.
Will have to look at Umbraco version 6.x to see if I can migrate from 4.11.x
Thanks for tall the help :-)
We're getting the same errors, but with MVC 4 and Umbraco 6. It only happens on 1 environment. Any idea what could be the problem?
Attempt by method 'Umbraco.Extensions.Controllers.Surface.PartialController.ShowTopMenu()' to access method 'System.Web.Mvc.Controller.PartialView(System.String, System.Object)' failed.
What routing do you have in place.
I thought I had seen this before with IIS, it was something stupid like having basic auth and another turned on. I will try and find what it was.
Ken can you post your code and also are you using IIS or webmatrix?
Could you post what the app pool settings are like if you are using .net4.5 ect :).
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted