@Html.EditorForModel with a dynamic UmbracoViewPage
I am trying to generate the inputs for my custom model in my view with: @Html.EditorForModel() like specified in the umbraco documentation. Instead of generating inputs for my variables it generates an input for the CurrentCulture. These are my classes.
public class ProductModel : RenderModel
{
public ProductModel(IPublishedContent content) : base(content)
{
}
[Required]
public string Name { get; set; }
[Required]
public string Daaaag { get; set; }
}
public class TestController : Umbraco.Web.Mvc.SurfaceController
{
// GET: Test
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult AddProduct(RenderModel model)
{
var productModel = new ProductModel(CurrentPage);
return null;
}
}
So my question is, how would I generate the Inputs for all these variables in my custom model so that when I click the input my ProductModel object has its variables filled with the inputs.
@Html.EditorForModel with a dynamic UmbracoViewPage
I am trying to generate the inputs for my custom model in my view with:
@Html.EditorForModel()
like specified in the umbraco documentation. Instead of generating inputs for my variables it generates an input for the CurrentCulture. These are my classes.This is my cshtml page: https://pastebin.com/g77m4hp1
This is my controller:
So my question is, how would I generate the Inputs for all these variables in my custom model so that when I click the input my ProductModel object has its variables filled with the inputs.
is working on a reply...