I am using ASP.NET MVC with c#.
I am using CheckBoxFor in my view for a boolean value of RememberMe.
This is my checkboxfor in view:
<%:Html.CheckBoxFor(model => model.RememberMe)%>
and fetching value of it in .js function.
By default, it is set to true but if I unchecked that box, still it is returning true value to the .js function.
Function for viewModel values:
function getViewModel() {
var viewModel = {
'UserName': $("#UserName").val(),
'Password': $("#Password").val(),
'RememberMe': $("#RememberMe").val()
};
return viewModel;
}
It is getting other values correct but RememberMe is true even if I Uncheched it
Please suggest me something.