Dropdown Selected Text
-
Hi, How do I get the value of the text selected in a dropdown list? I can get the value of it like this: objOrder.Type = Int32.Parse(cboOrderTypes.SelectedValue); But how do I get the text that is displayed to the user in the dropdown into a variable? I hope someone can help?? Regards, ma se
-
Hi, How do I get the value of the text selected in a dropdown list? I can get the value of it like this: objOrder.Type = Int32.Parse(cboOrderTypes.SelectedValue); But how do I get the text that is displayed to the user in the dropdown into a variable? I hope someone can help?? Regards, ma se
-
use
DropDownList1.SelectedItem.Text
property for text.Nav.
-- modified at 5:22 Monday 24th July, 2006
There is no selectedtext property.
-
There is no selectedtext property.
-
Thanks this works just fine.
-
to get the selected items text in a variable you can get like this: cboOrderTypes.SelectedItem.Text or if you want to get the value of the selected item then like this you can get: cboOrderTypes.SelectedItem.Value.ToString()
Best Regards, Apurva Kaushal
Thanks this works just fine.
-
Thanks but I managed with it.
-
Thanks but I managed with it.
-
Yes I know. I also thought it would be something like SelectedText because there is a SelectedValue. But thanks for getting back anyways. Cheers.
-
to get the selected items text in a variable you can get like this: cboOrderTypes.SelectedItem.Text or if you want to get the value of the selected item then like this you can get: cboOrderTypes.SelectedItem.Value.ToString()
Best Regards, Apurva Kaushal