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
Hi. Default MVC Model Binding doesn’t work if I try to call @Html.Action("Index", "Some") from LeBlender view.
Code of the View:
@inherits UmbracoViewPage<Lecoati.LeBlender.Extension.Models.LeBlenderModel> @Html.Action("Index", "Some")
and the code of my "Some" Controller:
public class SomeController : SurfaceController { public ActionResult Index( MyCustomModel model) { if(model == null){ model = new MyCustomModel(); model.Name = "SomeName"; } return View(model); }
and the code of my Index.cshtml
@inherits UmbracoViewPage<SomeNamespace.MyCustomModel> <form action="@Umbraco.AssignedContentItem.Url" method="GET"> @Html.TextBoxFor(x=>x.Name, Model.Name ,new { @class= "form-control" }) <div > <input value="submit" class="btn btn-primary" type="submit"> </div> </form>
MyCustomModel is always null after submit.
So, How can I get MyCustomModel after submit in my SomeController?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Default Model Binding doesn’t work with LeBlender
Hi. Default MVC Model Binding doesn’t work if I try to call
@Html.Action("Index", "Some") from LeBlender view.
Code of the View:
and the code of my "Some" Controller:
and the code of my Index.cshtml
MyCustomModel is always null after submit.
So, How can I get MyCustomModel after submit in my SomeController?
is working on a reply...