У меня есть приложение ASP.NET MVC с помощником Course.cs, внутри класса у меня есть список Student.
Мне нужно чтобы получить idStudent из класса Student, поместить его в @Html.Label, например, я передаю data_externalid = Course.idCourse, но я не знаю, как поместить (добавьте новую переменную, чтобы передать ее на метку) idStudent.
Большое спасибо
@foreach (AppSchool.Helpers.Course course in Model.ListCourse)
{
@Html.ActionLink(course.name, "GetCourse", "Student", routeValues: new { idCourse = course.idCourse }, htmlAttributes: null)
@course.name
@course.date_ini
@Html.Action("GetPlace", "Student", new { idCourse = course.idCourse })
@Html.Action("GetCurrentQuota", "Student", new { idCourse = course.idCourse })
@Html.Label("Cancel", new { @class = "cancel label label-danger", data_externalid = course.idCourse, id = "status-" + course.idCourse })
}
Подробнее здесь: https://stackoverflow.com/questions/783 ... -mvc-razor