How to update database from WebGrid in Asp.net MVC3
I want to edit my webgrid values and updated values save in database.
how can i do that using repository pattern.
supppose i have two columns in my WebGrid
开发者_开发问答Item Amount
A 0 (textbox)
B 0 (textbox)
C 0 (textbox)
Above values are displayed from database.
Now i want to edit amount column and want to save that in database.
any idea?
code in view for display values from database
@{
var grid = new WebGrid(Model, columnNames: new[] { "ItemName", "Amount" });
}
@grid.GetHtml(columns: grid.Columns(grid.Column("ItemName", header: "Item Name"),
grid.Column("Amount", header: "Amount", format: @<text><input name="Amount" type="text" value="@item.Amount" /></text>))
精彩评论