I've just started using Umbraco 4.11 and love the idea of using MVC with Umbraco - however I've gotten stuck with a particular problem that probably has a really simple solution - so I hope you guys can help me out :)
I've create a custom SurfaceController - like so :
[PluginController("Contact")]
public class ContactSurfaceController : SurfaceController
{
[ChildActionOnly]
public ActionResult Index()
{
var model = new ContactViewModel();
model.Text = "DEMO DEMO";
return PartialView(model);
}
}
The Index action-method makes use of a simple ViewModel that just contains a Text-property - simple stuff.
I then create my View - I wan't to have this placed in Views/Contact/Index.cshtml - hence the PluginController-attribute (as I've understood the usage of this).
I skipped the PluginController and renamed my class to ContactController - now all the routes are working great with my Views placed in ~/Views/Contact.
Routing problem with MVC SurfaceController
I've just started using Umbraco 4.11 and love the idea of using MVC with Umbraco - however I've gotten stuck with a particular problem that probably has a really simple solution - so I hope you guys can help me out :)
I've create a custom SurfaceController - like so :
The Index action-method makes use of a simple ViewModel that just contains a Text-property - simple stuff.
I then create my View - I wan't to have this placed in Views/Contact/Index.cshtml - hence the PluginController-attribute (as I've understood the usage of this).
My Index-view is as simple as it gets:
On my content page I then try to render this by calling:
But I get a runtime exception stating that :
No route in the route table matches the supplied values.
I Can't seem to figure out how to get on from here - so please please help me! :)
Note that I've also tried:
with the same result :(
I think I finally caught a break.
I skipped the PluginController and renamed my class to ContactController - now all the routes are working great with my Views placed in ~/Views/Contact.
is working on a reply...