Selected index change
-
why it is not wrking in (C#+Asp)n same code is working in Only c#. Is there any other event.. protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { TextBox2.Text = DropDownList1.Text; } respective text box is not getting updated. regards. shriya
-
why it is not wrking in (C#+Asp)n same code is working in Only c#. Is there any other event.. protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { TextBox2.Text = DropDownList1.Text; } respective text box is not getting updated. regards. shriya
-
Error 1 'int' does not contain a definition for 'Text' D:\TIS\Default.aspx.cs 27 53 D:\TIS\ nops..this is the error..Shriya
-
why it is not wrking in (C#+Asp)n same code is working in Only c#. Is there any other event.. protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { TextBox2.Text = DropDownList1.Text; } respective text box is not getting updated. regards. shriya
To get the selected Text from the dropdownlist TextBox2.Text = DropDownList1.SelectedItem.Text; To get the selected Value from the dropdownlist TextBox2.Text = DropDownList1.SelectedValue; (or) TextBox2.Text = DropDownList1.SelectedItem.Value; Regards,
Deepa
-
To get the selected Text from the dropdownlist TextBox2.Text = DropDownList1.SelectedItem.Text; To get the selected Value from the dropdownlist TextBox2.Text = DropDownList1.SelectedValue; (or) TextBox2.Text = DropDownList1.SelectedItem.Value; Regards,
Deepa
thnx Deepa,, Through collection its 100% possible..The basic problem is there tht the event (DropDownList2_SelectedIndexChanged)is not fired on ..so the problem is arising.. else the associated code is absolutly running fine(TextBox2.Text = DropDownList2.Text; TextBox2.Text = DropDownList1.SelectedValue;). Both statments r crect Regards shriya
-
thnx Deepa,, Through collection its 100% possible..The basic problem is there tht the event (DropDownList2_SelectedIndexChanged)is not fired on ..so the problem is arising.. else the associated code is absolutly running fine(TextBox2.Text = DropDownList2.Text; TextBox2.Text = DropDownList1.SelectedValue;). Both statments r crect Regards shriya
Make the autopostback event property of the dropdownlist to true.. Have you placed the dropdownlist on the form or in a panel??
where there is a will there is a way