Sep 17, 2008, 8:25 AM
[CLOSED] Add panel from codebehind
Hi,
Im trying to add a panel object from codebehind. When i compile and run the page nothing shows. How can solve this?
Mikael
Im trying to add a panel object from codebehind. When i compile and run the page nothing shows. How can solve this?
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < 2; i++)
{
Coolite.Ext.Web.Panel pnlTest = new Coolite.Ext.Web.Panel();
pnlTest.Title = i.ToString();
pnlTest.ID = i.ToString();
pnlTest.Html = "Content " + i;
divTest.Controls.Add(pnlTest);
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test2.aspx.cs" Inherits="Test2" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager ID="ScriptManager1" runat="server">
</ext:ScriptManager>
<div runat="server" id="divTest">
</form>
</body>
</html>
Best regardsMikael