Does Umbraco Forms validation work with strongly typed View Models
Hi,
I have another Umbraco Forms question (different from another recent question I posted recently)...
I am having a problem where validation is not working and I suspect it is because we are using strongly typed view models. I tried adding a SurfaceController that created the View Model for a new doc type with a simple template and it broke. The form will display and submit, but if it is missing required fields it just redisplays with no validation or error messages. Here's what my controller looks like:
namespace MySite.Controllers
{
using System.Web.Mvc;
using Umbraco.Web;
using MySite.Content;
using MySite.Models;
public class FormTestController : ContentMasterController
{
public ActionResult Index()
{
ArticlePageViewModel model = new ArticlePageViewModel();
MapBaseProperties(model);
model.MainContent = CurrentPage.GetPropertyValue<string>("bodyText");
return CurrentTemplate(model);
}
}
}
Note that the ContentMasterControlller is abstract and extends SurfaceController and is there to share the MapBaseProperties() method which maps some common fields to the model.
Does Umbraco Forms validation work with strongly typed View Models
Hi,
I have another Umbraco Forms question (different from another recent question I posted recently)...
I am having a problem where validation is not working and I suspect it is because we are using strongly typed view models. I tried adding a SurfaceController that created the View Model for a new doc type with a simple template and it broke. The form will display and submit, but if it is missing required fields it just redisplays with no validation or error messages. Here's what my controller looks like:
Note that the ContentMasterControlller is abstract and extends SurfaceController and is there to share the MapBaseProperties() method which maps some common fields to the model.
Any one run into similar issues?
Alex
is working on a reply...