hi
check this code
protected void Bt_Submit_Click(object sender, EventArgs e)
{
Txt2.Text = Txt1.Text;
int ItemsCnt = DrpList.Items.Count;
for (int i = 0; i <= ItemsCnt-1; i++)
{
DropDownList1.Items.Add(DrpList.Items[i].Text);
}
}
<form id="form1" runat="server">
<asp:TextBox ID="Txt1" runat ="server" ></asp:TextBox>
<asp:DropDownList ID="DrpList" runat ="server" >
<asp:ListItem Text ="Asp.net" Value ="0">Asp.net</asp:ListItem>
<asp:ListItem Text ="Vb.net" Value ="1">Vb.net</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Bt_Submit" runat ="server" Text ="Copy Data"
onclick="Bt_Submit_Click" />
<asp:TextBox ID="Txt2" runat ="server" ></asp:TextBox>
<asp:DropDownList ID="DropDownList1" runat ="server">
</asp:DropDownList>
</form>
Mark as Answer if its helpful to you
Kumaraspcode2009@gmail.com
Kishore22, if this helps please login to Mark As Answer. | Alert Moderator