View Full Version : Type of "Content" variable in DesktopConfig in .NET code behind.

May 02, 2016, 11:42 AM
I am trying to achieve what is posted here :
MVC EXT.NET Desktop Overview (http://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()
Html.X().Image() //something

What I am trying to achieve should like like this :

new DesktopConfig
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?

May 03, 2016, 7:46 PM
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!

May 19, 2016, 6:45 PM
It did! Thank you very much.