Could not find a Surface controller route in the RouteTable for controller name ContactSurfaceController
Hi,
I am using Umbraco 10. I'm attempting to use Surface Controller to send a mail via the Contact Page. But I am unable to use Umbraco.Web.Mvc, instead I am using Umbraco.Cms.Web.Website.Controllers Namespace. I ran the code and filled out all the fields on the contact page, but nothing happened when I clicked the submit button. I am getting this error "Could not find a Surface controller route in the RouteTable for controller name ContactSurfaceController". Is this because of the different namespace I used or some other issue?? Please Someone assist me. Thanks in Advance.
Could not find a Surface controller route in the RouteTable for controller name ContactSurfaceController
Hi, I am using Umbraco 10. I'm attempting to use Surface Controller to send a mail via the Contact Page. But I am unable to use Umbraco.Web.Mvc, instead I am using Umbraco.Cms.Web.Website.Controllers Namespace. I ran the code and filled out all the fields on the contact page, but nothing happened when I clicked the submit button. I am getting this error "Could not find a Surface controller route in the RouteTable for controller name ContactSurfaceController". Is this because of the different namespace I used or some other issue?? Please Someone assist me. Thanks in Advance.
Controller:
ContactSurfaceController.cs:
Models:
ContactForm.cs:
Views:
Contactus.cshtml:
You should refer to the controller as ContactSurface not ContactSurfaceController, the Cotroller part is not necesary
you can use either
or
Thank you.. Its working now..
is working on a reply...