L
Landley
Hi Everyone,
I have created a user control that contains two buttons. The buttons have
been created using <asp:Button> tag. I have then created another user
control that contains an <asp:Table>, that I dynamically add rows and cells
to. I am trying add my first user control to a TableCell. If I add any of
the usual .NET controls, it works fine. If I add my first user control, it
does not seem to appear.
I have turned page tracing on and the control appears in the Control Tree in
the TableCell, the visibility of user control has been dynamically to true.
What am I doing wrong?
[in .vb file]
<< this does not work >>
cell.Controls.Add(New MyButton(param1, param2))
<< this works >>
cell.Controls.Add(New Button)
[in mybutton user control]
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="MyButtonButton.ascx.vb" Inherits="MyNameSpace.MyButtonButton"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<asp:Button ID="FirstButton" Runat="server" Visible="True" Text="No.
1"></asp:Button><asp:Button ID="SecondButton" Runat="server" Visible="True"
Text="No. 2"></asp:Button>
Landers
I have created a user control that contains two buttons. The buttons have
been created using <asp:Button> tag. I have then created another user
control that contains an <asp:Table>, that I dynamically add rows and cells
to. I am trying add my first user control to a TableCell. If I add any of
the usual .NET controls, it works fine. If I add my first user control, it
does not seem to appear.
I have turned page tracing on and the control appears in the Control Tree in
the TableCell, the visibility of user control has been dynamically to true.
What am I doing wrong?
[in .vb file]
<< this does not work >>
cell.Controls.Add(New MyButton(param1, param2))
<< this works >>
cell.Controls.Add(New Button)
[in mybutton user control]
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="MyButtonButton.ascx.vb" Inherits="MyNameSpace.MyButtonButton"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<asp:Button ID="FirstButton" Runat="server" Visible="True" Text="No.
1"></asp:Button><asp:Button ID="SecondButton" Runat="server" Visible="True"
Text="No. 2"></asp:Button>
Landers