Type of "Content" variable in DesktopConfig in .NET code behind.

  1. #1

    Type of "Content" variable in DesktopConfig in .NET code behind.

    I am trying to achieve what is posted here :
    MVC EXT.NET Desktop Overview
    using code behind in my controler.
    I stopped on DesktopConfig creation.
    Original code looks as follows :
    DesktopConfig( Html.X().DesktopConfig()
                       //something
                        .Content(
                        @<text>
                            @(
                                Html.X().Image() //something
                            )
     
                            )
                        </text>
                        )
                )
    What I am trying to achieve should like like this :
    new DesktopConfig
                {
                    //something
                 Content = new Content{
                                new Image()
                           }
                    
                };
    But there is a problem :
    Object Content's type is "System.Web.UI.ITemplate" and I can't find any accaptable object to put there.
    Should I create my own class implementing ITemplate or is there any one which does it already in ext.net?
  2. #2
    Hello @Malin! Welcome to Ext.NET forums!

    From code behind, you can pile up controls on a Content space with ContentControls as follows:

    var deskConf = new DesktopConfig();
    deskConf.ContentControls.Add(new Ext.Net.Image());
    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    It did! Thank you very much.

Similar Threads

  1. [CLOSED] Objects missing in the "theForm"-Variable
    By Woyciniuk in forum 3.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 06, 2015, 1:16 PM
  2. Replies: 1
    Last Post: Sep 11, 2013, 5:39 PM
  3. [CLOSED] Problems when usin "Content" instead of "Items"
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 24, 2012, 1:43 PM
  4. Replies: 4
    Last Post: May 22, 2012, 10:40 AM
  5. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM

Posting Permissions