Feb 15, 2015, 12:45 AM
[CLOSED] Loading Panel Content from Model
Hi,
Can you please help me out populating a panel content from a Model.
My Model -
Index.cshtml
Can you please help me out populating a panel content from a Model.
My Model -
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace org.ctrla.model
{
public class HomeViewModel
{
public String Menu {
get
{
return "test test test";
}
}
}
}
My Controller [DirectMethod]
public ActionResult doLogin(string userName, String password)
{
HomeViewModel homeViewModel = new HomeViewModel();
return View("Index", homeViewModel);
}
Index.cshtml
<html>
<body>
@model org.ctrla.model.HomeViewModel
@Html.X().ResourceManager()
@(
Html.X().Viewport().Layout(LayoutType.Border)
.ItemsFromPage(this, "~/Views/Main/_North.cshtml")
.ItemsFromPage(this, "~/Views/Main/_West.cshtml")
.ItemsFromPage(this, "~/Views/Main/_Center.cshtml")
.ItemsFromPage(this, "~/Views/Main/_South.cshtml")
)
</body>
</html>
_West.cshtml@model org.ctrla.model.HomeViewModel
@(Html.X().Panel()
.Header(false)
.Region(Region.West)
.Collapsible(true)
.AutoScroll(true)
.Split(true)
.CollapseMode(CollapseMode.Mini)
.Border(false)
.Width(230)
.MaxWidth(230)
.Content(Model.Menu)
)
I am getting following Runtime Exception - CS1502: The best overloaded method match for 'Ext.Net.AbstractComponent.Builder<Ext.Net.Panel,Ext.Net.Panel.Builder>.Content(System.Func<object,object>)' has some invalid arguments
I even tried with - .Content(m=>m.Menu). it gives me following Compilation error - 'object' does not contain a definition for 'Menu' and no extension method 'Menu' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
Last edited by Daniil; Feb 20, 2015 at 7:20 PM.
Reason: [CLOSED]