如何在动态(数据库检查)中检查或取消选中复选框在Mvc Razor中的单个视图? [英] How Do I Checkbox Checked Or Unchecked In Dynamic(Database To Check)Single View In Mvc Razor?

查看:53
本文介绍了如何在动态(数据库检查)中检查或取消选中复选框在Mvc Razor中的单个视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮帮我...

编辑功能检索数据库值复选框在mvc razor引擎的单视图中选中或取消选中?

请帮帮我... ...

please help me ...
edit function retrieve database value check box is checked or unchecked in single view in mvc razor engine?
please help me......

推荐答案

假设您正在进行ajax调用以从数据库中检索数据,请将以下代码放在ajax调用的success函数中:



Assuming that you are making an ajax call to retrieve the data from database, put the below code in the success function of the ajax call:


('#checkboxId')。prop('checked',response.IsChecked);
('#checkboxId').prop('checked', response.IsChecked);





response.IsChecked保持布尔值true / false。

希望这会有所帮助。



"response.IsChecked" holds boolean value true/false.
Hope this helps.


这篇关于如何在动态(数据库检查)中检查或取消选中复选框在Mvc Razor中的单个视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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