Hi. I have a Umbraco 7 working fine locally in Visual Studio. I have a MVC form working fine as well. However when I upload the MVC form to my web hotel I get the error:
Exception Details: System.InvalidOperationException: No route in the route table matches the supplied values.
The error comes from the line calling my MVC controller:
@Html.Action("Index", "ContactFormSurface")
I have installed Umbraco at the web hotel separately meaning no upload of the main Umbraco files.
But I am stucked. I guess that the answer is simple since I have no big experience with the MVC. Maybe something's wrong with the namespace, maybe somthing else is not working. But any help will be highly appreciated :-)
The top code in my controller is:
using Agnieszka.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Umbraco.Core.Models;
using Umbraco.Web.Mvc;
using Umbraco.Web.Mvc.UmbracoTemplatePage;
using Umbraco.Web.Routing;
namespace Agnieszka.Controllers
{
public class ContactFormSurfaceController : Umbraco.Web.Mvc.SurfaceController
{
// GET: ContactFormSurface
public ActionResult Index()
{
return PartialView("ContactForm", new ContactFormViewModel());
}
MVC upload doesn't work
Hi. I have a Umbraco 7 working fine locally in Visual Studio. I have a MVC form working fine as well. However when I upload the MVC form to my web hotel I get the error:
The error comes from the line calling my MVC controller:
I have installed Umbraco at the web hotel separately meaning no upload of the main Umbraco files.
But I am stucked. I guess that the answer is simple since I have no big experience with the MVC. Maybe something's wrong with the namespace, maybe somthing else is not working. But any help will be highly appreciated :-)
The top code in my controller is:
// Lars
Hi Lars,
Umbraco uses it's own routing. You don't need to use controllers for rendering partial view. Try to use Html helper:
@Html.Partial("ContactForm")
But you need to create new model inside partial view - new ContactFormViewModel()
Thanks,
Alex
is working on a reply...