Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Based on this thread, https://our.umbraco.org/forum/developers/razor/40066-Model-binding-problem-when-multiple-forms-on-the-same-page-, I found http://code.lawrab.com/2012/05/using-bind-prefix-in-aspnet-mvc.html and was able to create pre-faced fields for two different forms on the same page. But now I'm stuck on the partial recognizing those pre-faced fields so that the form will process.
Here's the action line out of my controller:
[HttpPost] public ActionResult TopSendEmail([Bind(Prefix = "TopBlogSub")] NewsletterModel model)
Here's the line calling the partial:
@Html.Partial("TopNLForm", new BCW.NewsletterModel(), new ViewDataDictionary { TemplateInfo = new TemplateInfo { HtmlFieldPrefix = "TopBlogSub" } })
Here's the Inherients line out of my partial
@inherits Umbraco.Web.Mvc.UmbracoViewPage<BCW.NewsletterModel>
Here's the BeginUmbracoForm line out of my partial:
Html.BeginUmbracoForm("TopSendEmail", "NewsletterSurface")
What do I need to change in the HTML.BeginUmbracoFrom to so that it recognizes the prefaced fields? Or do I need to change the fields themselves?
Hi lonehorseend ,
You have to change ids and names of input fields inside the form. Like that :
id="
Thanks
You should be able to add html attributes and set the id of the form in the params of the BeginUmbracoForm
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Mutiple forms on one page - Html.BeginUmbracoForm question
Based on this thread, https://our.umbraco.org/forum/developers/razor/40066-Model-binding-problem-when-multiple-forms-on-the-same-page-, I found http://code.lawrab.com/2012/05/using-bind-prefix-in-aspnet-mvc.html and was able to create pre-faced fields for two different forms on the same page. But now I'm stuck on the partial recognizing those pre-faced fields so that the form will process.
Here's the action line out of my controller:
Here's the line calling the partial:
Here's the Inherients line out of my partial
Here's the BeginUmbracoForm line out of my partial:
What do I need to change in the HTML.BeginUmbracoFrom to so that it recognizes the prefaced fields? Or do I need to change the fields themselves?
Hi lonehorseend ,
You have to change ids and names of input fields inside the form. Like that :
id="
Thanks
You should be able to add html attributes and set the id of the form in the params of the BeginUmbracoForm
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.