开发者

Model binding List and creating single object

开发者 https://www.devze.com 2023-03-09 09:13 出处:网络
I have model in a view like this @model List<Products> I can itereate over it and show all the products. But on click of add button, I want to show a popup which will add a product (sending r

I have model in a view like this

@model List<Products>

I can itereate over it and show all the products. But on click of add button, I want to show a popup which will add a product (sending request to creat开发者_C百科e action).

public JSONResult create(Product P) {}

Create form is also on same page, so how I will only send a newly single product?


You may find the following blog post useful.

0

精彩评论

暂无评论...
验证码 换一张
取 消