Hi Team
I need some help, i want to create list of values using dropdownlist for, now on the view i am getting a null object when accessing them.
- @using (Html.BeginForm("SuperAdmin", "Home", FormMethod.Post))
- {
- <div class="form-group row">
- <label for="Content-Licence" class="col-sm-3 col-form-label">Content Licence</label>
- <div class="col-sm-5">
- @Html.DropDownListFor(model => model.Dashboard.CourseLicence, new SelectList(Model.lsteNtsaDashboard))
- </div>
- </div>
- }
- public ActionResult SuperAdmin() {
-
- var list = new List<string>() { "Private(Copyrighted)", "Public Domain", "Creative Commons Licences", "CC Attribution", "CC Attribution Share ALike", "CC Attribution Non-Commercial",
- "CC Attribution Non-Commercial Share Alike", "CC Attribution Non Directive", "CC Attribution Non-Commercial No Directives" };
- ViewBag.list = list;
-
- return View(list);
- }
-
- public class eNtsaDashboardViewModel
- {
- public string CourseName { get; set; }
- public List<eNtsaCourses> CourseLicence { get; set; }
-
- }