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
namespace UmbracoMVCDemo.FrontEnd.Controllers
{
public class DemoSurfaceController : Umbraco.Web.Mvc.SurfaceController
{
// // GET: /Demo/
public ActionResult Index()
{
return View();
}
}
}
and added a view
@{
ViewBag.Title = "Index";
}
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 MVC
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.
MVC 4 not working with Umbraco 4.11.9
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
and added a 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 MVC
Thanks
Ken
Hi Ken
Have you changed the template engine in /config/umbracoSettings.config to MVC? By default it's webforms.
/Jan
Hi,
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.
Thanks
Ken
Ok managed to get the routing working now but get a different error
One step at a time
Ken
You should call your sufarce controller action from a view with @Html.Action
Yep done that this is my front page view
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 :-)
Hello,
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?
Jeroen
Hi guys,
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 :).
Thanks,
Charlie
is working on a reply...