I am trying to figure out how to get a simple Contact Form SurfaceController working. The problem is that when I try to navigate to the Contact Us page, I get a "No route in the route table matches the supplied values." error.
My surface controller:
namespace UmbracoSurface2.Controllers
{
public class ContactFormSurfaceController : SurfaceController
{
public ActionResult Index()
{
return PartialView("ContactForm", new ContactFormViewModel());
}
}
}
My ContactForm partial:
@model UmbracoSurface2.Models.ContactFormViewModel
<form>
<div class="controls controls-row">
@Html.TextBoxFor(m => m.Name)
@Html.TextBoxFor(m => m.Email)
</div>
<div class="controls">
@Html.TextAreaFor(m => m.Message, new { rows="5" })
</div>
<div class="controls">
<button id="contact-submit" type="submit" class="btn btn-primary input-medium pull-right">Submit</button>
</div>
</form>
and my template:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "Master.cshtml";
}
@Html.Action("Index", "ContactFormController")
The one big difference between mine and the screencasts and examples I've found is that I'm using Visual Studio 2013 so the ASP.NET Website template has a newer version of MVC which I had to remove to get the UmbracoCms NuGet package to install. I also tried it without adding MVC to the project at the beginning.
Any help/suggestions would be appreciated,
Jason