Could not find a Surface controller route in the RouteTable for controller name
Hi all,
I'm creating a form and I'm coming a cross a routing issue, I have created forms in this exact way before but have never come across this issue.
I have included a screenshot of the error I'm getting as well as the code i have.
I have googled the issue and a lot of forums are saying i need to add the routing to a routing file found in the app_start folder but I cant find this anywhere, is this correct?
//MODEL
using System.ComponentModel;
namespace est1897_umbraco.Models
{
public class HomepageFormViewModel
{
[DisplayName("Pagename")]
public string PageName { get; set; }
[DisplayName("Title:")]
public string Title { get; set; }
[DisplayName("Firstname:")]
public string Firstname { get; set; }
[DisplayName("Surname:")]
public string Surname { get; set; }
[DisplayName("Telephone:")]
public string Telephone { get; set; }
[DisplayName("Email:")]
public string Email { get; set; }
[DisplayName("Against my assets:")]
public string Asset { get; set; }
[DisplayName("I would like to borrow:")]
public string BorrowAmount { get; set; }
}
}
Could not find a Surface controller route in the RouteTable for controller name
Hi all,
I'm creating a form and I'm coming a cross a routing issue, I have created forms in this exact way before but have never come across this issue.
I have included a screenshot of the error I'm getting as well as the code i have.
I have googled the issue and a lot of forums are saying i need to add the routing to a routing file found in the app_start folder but I cant find this anywhere, is this correct?
//MODEL
//CONTROLLER
//FORM VIEW
//VIEW
Thanks, Lewis
I have tried having the form view like this as well, which gets the same error:
A couple of things to try, in your Original form View, remove Controller from HomepageFormController to the following
@using(Html.BeginUmbracoForm("SubmitForm", "HomepageForm", new { @class = "js-validate" }))
In your RenderForm Controller Method you will need to pass through an instance of the Model
return PartialView("~/Views/Partials/Forms/HomepageForm.cshtml",new est1897_umbraco.Models.HomepageFormViewModel());
is working on a reply...