[CLOSED] Loading Panel Content from Model

  1. #1

    [CLOSED] Loading Panel Content from Model

    Hi,

    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]
  2. #2
    Hi,

    Just use Html property instead Content

Similar Threads

  1. Replies: 2
    Last Post: Aug 30, 2013, 2:49 PM
  2. [CLOSED] Mask position when loading Panel's content
    By RCN in forum 2.x Legacy Premium Help
    Replies: 10
    Last Post: Oct 17, 2012, 2:02 PM
  3. Tab Panel Content Loading
    By xMAC in forum 1.x Help
    Replies: 5
    Last Post: Dec 10, 2010, 7:07 AM
  4. Replies: 2
    Last Post: Mar 09, 2010, 12:55 PM
  5. Dynamic loading content page into Panel
    By wildspirit in forum 1.x Help
    Replies: 2
    Last Post: Feb 04, 2009, 5:59 PM

Posting Permissions