MVC CheckBoxFor value set from script

If we want to set value in CheckBoxFor value from script we can set value like this:

  function EditAccessPrevilige(AccessPrivilegeID, LoginID, EmployeeAccessPrivilege, PayrollPrivilege) {  
     $('#AccessPrivilegeInfo_LoginID').val(LoginID);  
     if (EmployeeAccessPrivilege == "True")  
       document.getElementById("AccessPrivilegeInfo_EmployeeAccessPrivilege").checked = true;  
     else  
       document.getElementById("AccessPrivilegeInfo_EmployeeAccessPrivilege").checked = false;  
     if (PayrollPrivilege == "True")  
       document.getElementById("AccessPrivilegeInfo_PayrollPrivilege").checked = true;  
     else  
       document.getElementById("AccessPrivilegeInfo_PayrollPrivilege").checked = false;  
     return false;  
   }  

Popular posts from this blog

WPF Crystal Report Viewer Using SAP

mvc razor textboxfor change event change another textboxfor value

ASP.NET MVC razor SAP Crystal report