text box have it,s text from DDl
<p>I have a drop-down list which gathers data from the database and a <code>textbox</code> which contains the text from the drop-down list when I select a value from the drop-down list. I tried to make this work, but no data appears in the <code>textbox</code> when I select a value from the drop-down list and no errors appear either. Can anyone help me?</p>

<p>aspx Code:</p>

<pre><code>&lt;table id="Tbl" runat="server" width="70%" border="1" cellspacing="1" cellpadding="1"&gt;
        &lt;tr&gt;
            &lt;td&gt;
                Select
            &lt;/td&gt;
            &lt;td&gt;
                &lt;asp:SqlDataSource ID="SDSOption" runat="server" ConnectionString="Data Source=ELARABY-1EACFA3\SQLEXPRESS;Initial Catalog=ElarabyGroup;Integrated Security=True"
                    ProviderName="System.Data.SqlClient" SelectCommand="SELECT [Id], [option] FROM [Option]"&gt;
                &lt;/asp:SqlDataSource&gt;
                &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
                    &lt;ContentTemplate&gt;
                        &lt;asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SDSOption" DataTextField="option"
                            DataValueField="Id" ondatabound="DropDownList1_DataBound" 
                            onselectedindexchanged="DropDownList1_SelectedIndexChanged"&gt;
                        &lt;/asp:DropDownList&gt;
                    &lt;/ContentTemplate&gt;
                    &lt;Triggers&gt;
                        &lt;asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged" /&gt;
                    &lt;/Triggers&gt;
                &lt;/asp:UpdatePanel&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;b style="font-style: italic"&gt;Select Option&lt;/b&gt; &lt;b style="font-style: italic"&gt;
                    &lt;br /&gt;
                    &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtOption"
                        Display="Dynamic" ErrorMessage="*" SetFocusOnError="True"&gt;&lt;b style="font-style: italic"&gt;*&lt;/b&gt;&lt;/asp:RequiredFieldValidator&gt;
                &lt;/b&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td class="style2"&gt;
                &lt;asp:Label ID="LblOption" runat="server" Text="Option"&gt;&lt;/asp:Label&gt;
            &lt;/td&gt;
            &lt;td class="style1"&gt;
                &lt;asp:TextBox ID="TxtOption" runat="server"&gt;&lt;/asp:TextBox&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;b style="font-style: italic"&gt;Note:Add Here Product Option&lt;/b&gt; &lt;b style="font-style: italic"&gt;
                    &lt;br /&gt;
                    &lt;asp:RequiredFieldValidator ID="RVOption" runat="server" ControlToValidate="TxtOption"
                        Display="Dynamic" ErrorMessage="*" SetFocusOnError="True"&gt;&lt;b style="font-style: italic"&gt;*&lt;/b&gt;&lt;/asp:RequiredFieldValidator&gt;
                &lt;/b&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style="font-style: italic"&gt;
            &lt;td class="style2"&gt;
                &amp;nbsp;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;asp:Button ID="BtnSubmit" runat="server" Height="20px" Text="Submit" Width="50px"
                    OnClick="BtnSubmit_Click" /&gt;
                &amp;nbsp;
            &lt;/td&gt;
            &lt;td align="left"&gt;
                &amp;nbsp; &lt;b&gt;&lt;i&gt;&lt;span&gt;&lt;a href="EditOption.aspx"&gt;
                    &lt;asp:Image ID="Image1" runat="server" ImageUrl="~/Backend/Image/www_4photos_net_1137678404.jpg"
                        Width="60px" /&gt;&lt;/a&gt; Display Other &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
</code></pre>

<p>CS Code:</p>

<pre><code> protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        TxtOption.Text += DropDownList1.SelectedItem.Value;
    }
</code></pre>
