【发布时间】:2018-11-01 19:56:43
【问题描述】:
我正在尝试通过单击按钮将字段动态添加到表单中。我可以通过调用 ajax 添加字段,但数据不会回传到服务器端。我理解添加字段仅将内容添加到客户端而不是服务器端的原因,但是我应该如何使用 ASP.Net MVC 5 来做到这一点?
public class Product
{
public int ID { get; set; }
public int SKU { get; set; }
public string ProductName { get; set; }
public int CategoryID { get; set; }
public Category Category { get; set; }
public List<Price> Prices { get; set; }
}
我正在尝试通过单击按钮向产品表单中添加更多价格字段。
【问题讨论】:
-
查看这篇文章。 mattlunn.me.uk/blog/2014/08/…
标签: asp.net-mvc-5