I have a PartialView that should receive a model like:
@model MiniSIGEweb.Models.StudentViewModel
And I have this model as a javascript variable viewModel.selectedStudent
:
<script>
var viewModel = kendo.observable({
dataSource: dataSource,
selectedStudent: {},
/*...*/
});
/*...*/
</script>
How can I pass this variable to the PartialView?
@Html.Partial("_Edit.Mobile", /*Here I should pass the variable*/)
I'm not sure if this is important but I'm appending the 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; }
}