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))
- {
- class="form-group row">
- ="Content-Licence" class="col-sm-3 col-form-label">Content Licence
class="col-sm-5">- @Html.DropDownListFor(model => model.Dashboard.CourseLicence, new SelectList(Model.lsteNtsaDashboard))
- }
- 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
CourseLicence { get; set; } - }

Farhan AhmedPosted Sep 7, 2020, 8:46 AM