PDA

View Full Version : [CLOSED] How to create Panel Loader programmatically



Daly_AF
Aug 05, 2012, 12:59 PM
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"

Daniil
Aug 06, 2012, 10:11 AM
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>

Daly_AF
Aug 06, 2012, 10:50 AM
Thank you it works