i have a checkbox in view based upon database data(boolean) it should be checked and unchecked when that view loading
What i did
in view
@model RelSystem.DL.Model.Admin.UserAccount
@{
ViewBag.Title = "UserAccount";
}
UserAccount
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
Super User
@Html.CheckBoxFor(model => model.SuperUsrChk)
In contoller action
public ActionResult UserAccount()
{
UserAccount UA = new UserAccount();
UA.SuperUsrChk = true; //Checkbox model
return View(UA);
}
Model
public bool SuperUsrChk { get; set; }
public bool RequestorUsrChk { get; set; }
I am getting output as i need , please help on this
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manav PandyaPosted Jan 16, 2018, 6:26 AM