saeed31641
شنبه 06 دی 1393, 21:21 عصر
با سلام
من میخوام دوتا مدل رو تو یه صفحه استفاده کنم
روش کار م اینه یه کلاس تعریف کردم
public class ViewModel
{
public IEnumerable<Mvc_baker.Areas.admin.Models.Post> Post { get; set; }
public PagedList.IPagedList<Post> Postpoages { get; set; }
}
تو صفحه اصلی فراخوانیش کردم
@model Mvc_baker.Areas.admin.Models.ViewModel
@{
Layout = null;
ViewBag.Title = "AddPostUser";
Layout = "~/Areas/admin/Views/Shared/_AdminLayout.cshtml";
}
ولی متاسفانه کنترل رو نمیشناسه
<td class="tdtext">
@Html.TextBoxFor(m => m.Name, new { id = "Name", @style = "width: 175px;" })
@Html.ValidationMessageFor(x => x.Name, null, new { @class = "help-inline" })
</td>
مشکل کجاست؟؟
من میخوام دوتا مدل رو تو یه صفحه استفاده کنم
روش کار م اینه یه کلاس تعریف کردم
public class ViewModel
{
public IEnumerable<Mvc_baker.Areas.admin.Models.Post> Post { get; set; }
public PagedList.IPagedList<Post> Postpoages { get; set; }
}
تو صفحه اصلی فراخوانیش کردم
@model Mvc_baker.Areas.admin.Models.ViewModel
@{
Layout = null;
ViewBag.Title = "AddPostUser";
Layout = "~/Areas/admin/Views/Shared/_AdminLayout.cshtml";
}
ولی متاسفانه کنترل رو نمیشناسه
<td class="tdtext">
@Html.TextBoxFor(m => m.Name, new { id = "Name", @style = "width: 175px;" })
@Html.ValidationMessageFor(x => x.Name, null, new { @class = "help-inline" })
</td>
مشکل کجاست؟؟