No route in the route table matches the supplied values.
Hi guys,
I've a big problem with getting this contact form to work with html.action
Here's my ContactFormSurfaceController.cs:
public class ContactFormSurfaceController : SurfaceController
{
public ActionResult ShowContactForm()
{
return PartialView("ShowContactForm", new ContactFormViewModel());
}
}
Here's my ContactFormViewModel.cs:
public class ContactFormViewModel
{
[Required]
public string Navn { get; set; }
[Required]
[EmailAddress]
public string Email { get; set; }
[Required]
public string Emne { get; set; }
[Required]
public string Besked { get; set; }
}
That's how I use the Html.Action on Contactsection.cshtml:
I'm facing the same issue. I have not included app_data in the solution and have checked for typos in the controller/ action multiple times. Can someone help me with this?
It's working now!!! Thanks a lot! I excluded the model folder in App_data folder - I did a clean solution, rebuild and restarted VS and it worked after that,
but I don't understand where this folder comes from - it wasn't there in my previous projects?
I think you'd be best to start a new thread - I have a vague recollection that this can happen with Unobtrustive validation if you haven't correctly correctly included the JS libraries on the template though.
No route in the route table matches the supplied values.
Hi guys,
I've a big problem with getting this contact form to work with html.action
Here's my ContactFormSurfaceController.cs:
Here's my ContactFormViewModel.cs:
That's how I use the Html.Action on Contactsection.cshtml:
And this is my ShowContactForm.cshtml page:
But it always says: "No route in the route table matches the supplied values"
Hope you guys can help me with this - I've really struggled!
Thanks in advance
//Sharmarke
Hi Sharmarke,
It sounds remarkably similar to this issue:
https://our.umbraco.org/forum/templates-partial-views-and-macros/77127-controllers-different-between-umbraco-7-and-umbraco-743
Have you included the MVC files in your solution and rebuilt from Visual Studio?
Kind regards
Steve
Hi Steve,
Here's my files:
When I build the solution it says:
"There were build erros. Would you like to continue and run the last successful build?"
And I rebuild the solution it says:
"Rebuild all failed"
Hi,
There will be more detailed errors that will help you work out what's wrong (usually something has been mis-spelt or an include not correct).
Looks for the error list tab at the bottom - ignore warnings but ensure the errors option is selected.
I got 122 errors and 3 warnings,
most of the errors comes from a file named models.generated.cs
Some of the errors:
And the warnings:
Have you included in your solution the App_Data/Models folder and all it's contents.
HINT: don't! This folder is generated at run time and included as Umbraco starts.
To fix the above right click on the folder and Exclude from Project.
HTH
Steve
Hi! I had this issue too. The folder wasn't included but a build did the trick.
Hello All,
I'm facing the same issue. I have not included app_data in the solution and have checked for typos in the controller/ action multiple times. Can someone help me with this?
What might have confused you is in the Views you may see a red squiggly under the Document Type model
e.g.
This is fine and can be ignored.
Steve
It's working now!!! Thanks a lot! I excluded the model folder in App_data folder - I did a clean solution, rebuild and restarted VS and it worked after that,
but I don't understand where this folder comes from - it wasn't there in my previous projects?
The models builder is a new feature in the latest version.
You can switch it off -
http://www.zpqrtbnk.net/posts/purelive-models-introduction
Thanks!
Can you help me with another minor problem, steve?
I haven't event clicked the send button and yet it shows the validations errors to me
This is my contact form:
I think you'd be best to start a new thread - I have a vague recollection that this can happen with Unobtrustive validation if you haven't correctly correctly included the JS libraries on the template though.
Kind regards
Steve
You right, I'll start a new thread instead.
But thanks for the help before, Steve!
is working on a reply...