Well, I can get Geoffreys example to work (once, that is one control added), but if I use a constructor in my own example it does not work.
If I use the LoadControl it does work.
The sample below does not work. If you replace the line:
WebApplicationExtNetTest.Test.Comment cc = new WebApplicationExtNetTest.Test.Comment();
with
Control cc = this.LoadControl("Comment.ascx");
it will work (at least once).
Also, if I take Geoffreys example and use a contructor instead of LoadControl, it does not work.
Can you try it to confirm?
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" 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 id="Head1" runat="server">
<title>ToolTips - Ext.NET Examples</title>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
}
[DirectMethod]
public void asd()
{
WebApplicationExtNetTest.Test.Comment cc = new WebApplicationExtNetTest.Test.Comment();
this.PanelComments.ContentControls.Add(cc);
this.PanelComments.UpdateContent();
}
</script>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Button ID="Button1" runat="server" Text="ok">
<Listeners>
<Click Handler="Ext.net.DirectMethods.asd();" />
</Listeners>
</ext:Button>
<ext:Panel ID="PanelComments" runat="server" Layout="FormLayout" Padding="3" Title="Comments" IconCls="message" Height="200">
</ext:Panel>
</form>
</body>
</html>
Comment.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Comment.ascx.cs" Inherits="WebApplicationExtNetTest.Test.Comment" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<ext:Panel runat="server" ID="ChildPanel1" BodyStyle="background: #FFFDDE">
<Items>
<ext:Label runat="server" Text="My Label" />
</Items>
</ext:Panel>