ASP.NET Framework 4.0 MVC C#
I have created a 2 model in a class and pass it to view and the other to a partial view. But the partial always return exception.
it is something like this:
pls give advice. TIACode://my class public class myIndexData { //display record details public stp_Student_Result StudentDetail { get; set; } //display record sublist display (note: all of my table is joined/related dynamically/only in my stored procedure) public List<stp_Courses_Result> CourseLists { get; set; } } //in my controller: var myIndexData= new myIndexData() { StudentDetail = Db.stp_Student(id).Single(), CourseLists = Db.stp_Courses(id).ToList() }; return View(myIndexData); //in my view @model SWB2MVC.Models.myIndexData @Model.StudentDetail.Name // this works displaying the main record model! @Html.Partial("_partialpage", Model.CourseLists) = this one throw exceptions! //in my partial view @model IList<stp_Courses_Result>





Reply With Quote
