I am adding the checkbox in Dropdownlist for multiview..My code is below.
In view page:
- class="col-md-10">
- @Html.ListBoxFor(model => model.SkillArray, (IEnumerable
)ViewBag.SkillList as SelectList, - new { style = "width:100%", @id = "Skill", multiple = "multiple", @class = "form-control", })
- @Html.ValidationMessageFor(model => model.Skill, "", new { @class = "text-danger" })
- @Html.ListBoxFor(model => model.SkillArray, (IEnumerable
In javascript:
In HomeController:(for creating dropdownlist)
- string constr = ConfigurationManager.ConnectionStrings["Databaseconnection"].ToString();
- SqlConnection cons = new SqlConnection(constr);
- SqlDataAdapter _daa = new SqlDataAdapter("Select * From Skill", constr);
- DataTable _dt1 = new DataTable();
- _daa.Fill(_dt1);
- ViewBag.SkillList = ToSelectList(_dt1, "id", "Skill");
- return View();
Then am using this Bootstrap links:
- "https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css" rel="stylesheet" />
- "stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
(Am using this above links for my project total design is affected..also the checkbox is not responding)
How to resolve this).
Jignesh KumarPosted Apr 24, 2021, 5:31 AM
Aarti GuptaPosted Apr 23, 2021, 3:16 PM
Salman BegPosted Apr 23, 2021, 12:58 PM