and the model for the Menu, which is a collection retrieved frm the database with the Entity Framework.
public class PropertyMenuModel
{
public Int64 PropertyID { get; set; }
public string PictureUrl { get; set; }
public string StreetAddress { get; set; }
public string City { get; set; }
public string State { get; set; }
}
ARTIS
Member
69 Points
94 Posts
Re: Creating 2 partial views with different models
May 07, 2012 03:26 PM|LINK
I am getting: Compiler Error Message: CS0119: 'PMP.Controllers.PropertyMenuController' is a 'type', which is not valid in the given context
My main page looks like:
<table style="text-align: Left; vertical-align: Top" border="0" cellpadding="5"> <tr> <td>@Html.Partial("_PropertyMenu", PMP.Controllers.PropertyMenuController)</td> <td> @Html.Partial("_Property") </td> </tr> </table>The Property Menu
@model IEnumerable<PMP.Models.PropertyMenuModel> <script language="javascript" type="text/javascript"> var menuColorSelected = '#99FF99'; var menuColorNormal = '#eeeeff'; var menuColorRejected = '#FFA07A'; var menuColorHighlight = '#FFDA79'; ****Java script functions **** </script> <div id="RoundedContainer" style="width: 300px; height: 650px; overflow: auto;"> @foreach (var item in Model) { <li id='@item.PropertyID' style="cursor: pointer; list-style-type: none;" onmouseout='menuMouseOut(this)' onmouseover= 'menuMouseOver(this)' onclick='LoadListing_Click(this, @item.PropertyID)'> <table style="background-color: transparent; text-align: center; vertical-align: middle" border="0" cellpadding="5"> <tr> <td style="width: 83px; text-align: center"> <table id="TablePhoto" runat="server" border="0" cellpadding="0"> <tr> <td> <img alt='' src='@item.PictureUrl' /> </td> </tr> </table> </td> <td style="text-align: left"> @item.StreetAddress <br /> @item.City <br /> @item.State </td> </tr> </table> </li> } <br /> </div>and the model for the Menu, which is a collection retrieved frm the database with the Entity Framework.
public class PropertyMenuModel { public Int64 PropertyID { get; set; } public string PictureUrl { get; set; } public string StreetAddress { get; set; } public string City { get; set; } public string State { get; set; } }