Hi Team
I am trying to fix this errror and was not successfull, can anyone mate help me on this error.
- public ActionResult CourseList()
- {
- 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" };
- List
select_list = new List (); - var query = from li in list
- select new SelectListItem()
- {
- Value = li.ToString(),
- Text = li.ToString(),
- };
- select_list = query.ToList();
- ViewBag.list = select_list;
- return View();
- }
- @using (Html.BeginForm("CourseList", "Home", FormMethod.Post))
- {
- class="form-group row">
- ="Content-Licence" class="col-sm-3 col-form-label">Content Licence
class="col-sm-5">- @Html.DropDownListFor(m => Model.Dashboard.CourseLicence, ViewBag.list as List
) // This throws an error here: no ViewData item of type. - }
- public class RegCoursesViewModel
- {
- public eNtsaCourses Courses { get; set; }
- public eNtsaDashboardViewModel Dashboard { get; set; }
- public List
lsteNtsaDashboard { get; set; } - public RegCoursesViewModel MainModel { get; set; }
- }
Guest UserPosted Sep 8, 2020, 5:43 AM
Sachin SinghPosted Sep 7, 2020, 9:30 AM
{
public string name { get; set; }
}