Using this I make one partial view Contact.cshtml and add document type = ContactUs (back office)which work as a controller in MVC form also one makes custom model and bind as mention below code.
public ActionResult Contact(ContentModel model)
{
var contactUsModel = new ContactUsModel(model.Content);
return View(contactUsModel);
}
ContaUsModel.cs which work as Model
public class ContactUsModel : ContentModel
{
public ContactUsModel(IPublishedContent content) : base(content)
{
}
public int Id { get; set; }
[Required]
[DisplayName("Full Name")]
public string FullName { get; set; }
[DisplayName("Email Address")]
public string Email { get; set; }
[DisplayName("Phone (Optional)")]
public string Phone { get; set; }
public string Message { get; set; }
}
Using this I call ContactUsController bind model and render in view. But after submit form without any entry I can`t fire the validation message for this because same method call again. So can you please help to how display validation message and also get dynamic document type node in code and bind save entry which can display at back end office also.
After submitting form I need to configure the custom mail configuration which sends multiple emails with a template.
Hope you understand my question and find the solution as soon as possible so I can easily implement in the project.
Make Custom Form, Model Validation and List Form in Back office, Custom Mail Configuration with MVC Razor in Umbraco 8.1.0
Hello All,
I am newer in UmbracoCMS and make one project using Umbraco 8.1.0 version which before months ago release by Umbraco Team.
I need to implement one Contact us custom form in MVC with below features.
For all thing, I getting one reference link https://our.umbraco.com/documentation/reference/routing/custom-controllers
Using this I make one partial view Contact.cshtml and add document type = ContactUs (back office)which work as a controller in MVC form also one makes custom model and bind as mention below code. public ActionResult Contact(ContentModel model) {
ContaUsModel.cs which work as Model public class ContactUsModel : ContentModel { public ContactUsModel(IPublishedContent content) : base(content) { } public int Id { get; set; } [Required] [DisplayName("Full Name")] public string FullName { get; set; } [DisplayName("Email Address")] public string Email { get; set; } [DisplayName("Phone (Optional)")] public string Phone { get; set; } public string Message { get; set; } } Using this I call ContactUsController bind model and render in view. But after submit form without any entry I can`t fire the validation message for this because same method call again. So can you please help to how display validation message and also get dynamic document type node in code and bind save entry which can display at back end office also.
After submitting form I need to configure the custom mail configuration which sends multiple emails with a template.
Hope you understand my question and find the solution as soon as possible so I can easily implement in the project.
Thanks in Advance.
is working on a reply...