0
我应该收到这样一个模型PartialView:传递一个Javascript变量作为模型的PartiaView在ASP.NET MVC
@model MiniSIGEweb.Models.StudentViewModel
而且我有这个模型作为一个javascript变量viewModel.selectedStudent
:
<script>
var viewModel = kendo.observable({
dataSource: dataSource,
selectedStudent: {},
/*...*/
});
/*...*/
</script>
如何将此变量传递给PartialView?
@Html.Partial("_Edit.Mobile", /*Here I should pass the variable*/)
我不知道这是重要的,但我追加StudentViewModelClass:
public class StudentViewModel
{
public long Id { get; set; }
[Required]
public string Name { get; set; }
[Required]
[Range(1, 100)]
public Nullable<int> Age { get; set; }
[Required]
public string Course { get; set; }
[Required]
[Display(Name = "School")]
public string SchoolName { get; set; }
[Required]
public string City { get; set; }
[Required]
public string Country { get; set; }
public Nullable<System.DateTime> BuildDate { get; set; }
}