S
Softimax
Hi!
I want to change the position of a generic control. I want to append it
to a different parent.
I try some methods but I have some problem with complex controls (like
dropdown, checkboxlist)
I wrote a simple code for testing.
If you try to check something and write in textbox, after two click you
lose only checkboxes!
WHY?
Please, help me. Thanks a lot
Roberto
---------------------------------------------------------------------------
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CheckBoxList1.Items.Add("One");
CheckBoxList1.Items.Add("Two");
CheckBoxList1.Items.Add("Three");
}
}
protected void Button2_Click(object sender, EventArgs e)
{
Panel2.Controls.Add(Panel1);
}
protected void Button3_Click(object sender, EventArgs e)
{
Panel3.Controls.Add(Panel1);
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<aspanel ID="Panel1" runat="server"
Height="50px" Width="125px"
BorderColor="#C0C000" BorderStyle="Solid">
<asp:CheckBoxList ID="CheckBoxList1" runat="server" />
<asp:TextBox ID="TextBox1" runat="server" />
</aspanel>
<br />
<asp:Button ID="Button2" runat="server"
OnClick="Button2_Click" Text="Button" />
<br />
<aspanel ID="Panel2" runat="server"
BorderColor="Red" BorderStyle="Solid"
Height="50px" Width="125px">
</aspanel>
<br />
<asp:Button ID="Button3" runat="server"
OnClick="Button3_Click" Text="Button" />
<br />
<aspanel ID="Panel3" runat="server"
BorderStyle="Solid"
Height="50px" Width="125px">
</aspanel>
</form>
</body>
</html>
I want to change the position of a generic control. I want to append it
to a different parent.
I try some methods but I have some problem with complex controls (like
dropdown, checkboxlist)
I wrote a simple code for testing.
If you try to check something and write in textbox, after two click you
lose only checkboxes!
WHY?
Please, help me. Thanks a lot
Roberto
---------------------------------------------------------------------------
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CheckBoxList1.Items.Add("One");
CheckBoxList1.Items.Add("Two");
CheckBoxList1.Items.Add("Three");
}
}
protected void Button2_Click(object sender, EventArgs e)
{
Panel2.Controls.Add(Panel1);
}
protected void Button3_Click(object sender, EventArgs e)
{
Panel3.Controls.Add(Panel1);
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<aspanel ID="Panel1" runat="server"
Height="50px" Width="125px"
BorderColor="#C0C000" BorderStyle="Solid">
<asp:CheckBoxList ID="CheckBoxList1" runat="server" />
<asp:TextBox ID="TextBox1" runat="server" />
</aspanel>
<br />
<asp:Button ID="Button2" runat="server"
OnClick="Button2_Click" Text="Button" />
<br />
<aspanel ID="Panel2" runat="server"
BorderColor="Red" BorderStyle="Solid"
Height="50px" Width="125px">
</aspanel>
<br />
<asp:Button ID="Button3" runat="server"
OnClick="Button3_Click" Text="Button" />
<br />
<aspanel ID="Panel3" runat="server"
BorderStyle="Solid"
Height="50px" Width="125px">
</aspanel>
</form>
</body>
</html>