You could try this code
ASPX
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="dynamicControl.ascx.cs" Inherits="dynamicControl" %>
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true"
oncheckedchanged="CheckBox1_CheckedChanged" />
<asp:DropDownList ID="DropDownList1" runat="server" visible="false">
</asp:DropDownList>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
CodeBehind
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
DropDownList1.Visible = CheckBox1.Checked;
TextBox1.Visible = !CheckBox1.Checked;
}
This snippet will show a dropDownList if CheckBox is checked and change to TextBox if it's not checked. Despite this is possible I don't think this is the right approach. (eg: AutoPostBack needed, set visibility...)
What do you try to achieve?