开发者

Icon to delete item from list in mvc3 list

开发者 https://www.devze.com 2023-04-01 09:14 出处:网络
I have a mvc3 strong typedpartial view with a viewmodel containig a list of items. I use a foreach-loop to genereate a table of this items.

I have a mvc3 strong typed partial view with a viewmodel containig a list of items.

I use a foreach-loop to genereate a table of this items.

There should be an icon on each line to delete that item from the list. the delete should be a call to a service, to delete the item fr开发者_Go百科om the database and remove the item from the model, the refresh should be AJAX, so I don't need to refresh the whole page.

is ajax.actionlink the right thing to use or should I do something else?


Yes, you can use Ajax.ActionLink to call action for deleting items on the server. However you will need to refresh your table/grid additionaly calling other actions or just remove current row using javascript (if you don't have pager or something like this).

0

精彩评论

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