如何使用jquery在asp.net中启用和禁用usercontrol [英] How to enable and disable usercontrol in asp.net using jquery
问题描述
嗨朋友们,
我想在没有页面加载的情况下在aspx页面中更改复选框时启用和禁用用户控件。
你能帮帮我吗?
这是我的代码。
功能chkedchange()
{
if(document.getElementById('chkbox')。checked === false){
$(# usercontrolId)。val(0);
$('#usercontrolId')。attr(disabled,disabled);
}
else {
$(#usercontrolId)。removeAttr(disabled);
}
}
谢谢,
Ramana
(#usercontrolId)。val (0);
('#usercontrolId')。attr(禁用,禁用);
}
else {
(#usercontrolId)。removeAttr (禁用);
}
}
谢谢,
拉玛纳
Hi Friends,
I want to enable and disable a usercontrol when checkbox changed in aspx page without pageloading.
Could you please help me??
Here is my code.
function chkedchange()
{
if (document.getElementById('chkbox').checked === false) {
$("#usercontrolId").val("0");
$('#usercontrolId').attr("disabled", "disabled");
}
else {
$("#usercontrolId").removeAttr("disabled");
}
}
Thanks,
Ramana
("#usercontrolId").val("0");
('#usercontrolId').attr("disabled", "disabled");
}
else {
("#usercontrolId").removeAttr("disabled");
}
}
Thanks,
Ramana
这篇关于如何使用jquery在asp.net中启用和禁用usercontrol的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!