7asemoon
شنبه 02 مرداد 1395, 21:08 عصر
دوستان ممنون میشم اگر میتونید خیلی سریع راهنمایی کنید
من زمانی که میخام چندتا مدل رو در ویو پاس بدم با خطا مواجه میشم انواع و اقسام راه ها رو هم تست کردم جواب نگرفتم لطفا راهنمایی کنید
به این صورت پیاده کردم
@model University.ViewModel.EducationalBackground.Educati onalBackgroundListViewModel
@{
ViewBag.Title = "سوابق تحصیلی";
}
@{ Html.RenderPartial(MVC.Details.Views._EducationalB ackgroundAjax, Model);}
و در قسمت بعد
@model University.ViewModel.EducationalBackground.Educati onalBackgroundListViewModel
@foreach (var e in Model.EducationalBackgrounds)
{
@Html.Partial(MVC.Details.Views.ViewNames._Educati onalBackgroundItem, e)
}
و نهایتا
@using University.DomainClasses.Entities.ApplicantInfo
@using University.Utility
@model University.ViewModel.EducationalBackground.Educati onalBackgroundViewModel
<div class="rtl-content">
<div class="item">
<div class="item_inner">
<h2><i class="fa fa-caret-left"></i> نام و نام خانوادگی</h2>
<div class="desc">@Model.Field</div>
</div>
<div class="clearfix"></div>
</div>
</div>
ولی زمانی که اجرا میگیرم با این خطا مواجه میشم
The model item passed into the dictionary is of type 'University.ViewModel.EducationalBackground.Educat ionalBackgroundViewModel', but this dictionary requires a model item of type 'University.ViewModel.EducationalBackground.Educat ionalBackgroundListViewModel'.
من زمانی که میخام چندتا مدل رو در ویو پاس بدم با خطا مواجه میشم انواع و اقسام راه ها رو هم تست کردم جواب نگرفتم لطفا راهنمایی کنید
به این صورت پیاده کردم
@model University.ViewModel.EducationalBackground.Educati onalBackgroundListViewModel
@{
ViewBag.Title = "سوابق تحصیلی";
}
@{ Html.RenderPartial(MVC.Details.Views._EducationalB ackgroundAjax, Model);}
و در قسمت بعد
@model University.ViewModel.EducationalBackground.Educati onalBackgroundListViewModel
@foreach (var e in Model.EducationalBackgrounds)
{
@Html.Partial(MVC.Details.Views.ViewNames._Educati onalBackgroundItem, e)
}
و نهایتا
@using University.DomainClasses.Entities.ApplicantInfo
@using University.Utility
@model University.ViewModel.EducationalBackground.Educati onalBackgroundViewModel
<div class="rtl-content">
<div class="item">
<div class="item_inner">
<h2><i class="fa fa-caret-left"></i> نام و نام خانوادگی</h2>
<div class="desc">@Model.Field</div>
</div>
<div class="clearfix"></div>
</div>
</div>
ولی زمانی که اجرا میگیرم با این خطا مواجه میشم
The model item passed into the dictionary is of type 'University.ViewModel.EducationalBackground.Educat ionalBackgroundViewModel', but this dictionary requires a model item of type 'University.ViewModel.EducationalBackground.Educat ionalBackgroundListViewModel'.