jquery和MVC3相关的代码,用于删除表中的选定行 [英] jquery and MVC3 related code to remove selected row in the table

查看:84
本文介绍了jquery和MVC3相关的代码,用于删除表中的选定行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





你可以提供删除Asp.net 4.0 MVC3中删除行的代码......

此删除按钮出现在每一行中,并在每一行中动态绑定。

此行包含复选框,文本框,下拉列表和日期时间日历。

所有这些控件必须在删除按钮单击时处理。

Hi ,

Can u please provide code for deleting a row on click of delete in Asp.net 4.0 MVC3...
This delete button is present in the every row and is dynamically binded in every row.
This row contains checkboxes,textbox,dropdown and Date time calendar.
All these controls must be handled on delete button click.

推荐答案

您可以按照以下说明进行操作: -



i)在动态创建行时,只需将行主键值附加到删除图标的id,或者添加一个单独的属性,其中包含记录主键的值。



ii )现在点击删除图标点击只需从图标的ID中获取特定的主键值。



iii)然后进行ajax调用以删除记录通过传递行的主键。当行被删除时重新绑定网格/表格数据。





希望这对你有所帮助。





是的 Sergey Alexanrovich 是正确的,请在你的问题中礼貌而不是命令。
You can do as described below :-

i) While creating the rows dynamically just append the row primary key value to id of the delete icon or add a separate attribute with value of the primary key for the record.

ii) Now on click of the delete icon click just get that specific primary key value from the ID of the icon.

iii) Then make an ajax call to delete the record by passing the primary key of the row. When the row is being deleted rebind the grid/table data.


Hope this will be of help to you.


And yes Sergey Alexanrovich is correct , please have politeness in your questions rather than command.


这篇关于jquery和MVC3相关的代码,用于删除表中的选定行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆