[CLOSED] How to create Panel Loader programmatically

  1. #1

    [CLOSED] How to create Panel Loader programmatically

    Hi,
    I implemented programmatically a Panel with a Loader this is the code below :
     Panel subPanel = new Panel();
                subPanel.Loader.ID = "_" + tabTag + "Loder";
    I had a crash on the second instruction, this is the exception : "Object reference not set to an instance of an object"
    Last edited by Daniil; Aug 06, 2012 at 12:17 PM. Reason: [CLOSED]
  2. #2
    Hi,

    You should apply a ComponentLoader instance.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Ext.Net.Panel p = new Ext.Net.Panel();
                p.Width = 400;
                p.Height = 400;
    
                ComponentLoader loader = new ComponentLoader();
                loader.Mode = LoadMode.Frame;
                loader.Url = "http://ext.net";
    
                p.Loader = loader;
    
                this.Controls.Add(p);
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    </body>
    </html>
  3. #3
    Thank you it works

Similar Threads

  1. Panel Loader example in Razor
    By basder in forum 2.x Help
    Replies: 4
    Last Post: Mar 24, 2014, 3:34 PM
  2. [CLOSED] ext:Panel with Items and Loader (mixed mode)
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 24, 2012, 2:45 PM
  3. Replies: 5
    Last Post: Oct 03, 2010, 8:55 PM
  4. Programmatically create listeners
    By Ciaro in forum 1.x Help
    Replies: 6
    Last Post: Jan 09, 2010, 2:56 PM
  5. Help to create tabs programmatically
    By LuB in forum 1.x Help
    Replies: 3
    Last Post: Oct 20, 2008, 8:14 AM

Posting Permissions