This turned out to be a very hard task. I had to save it in a hidden field to get it correctly.
>Hi everybody,
>
>I have a DropDown list. I have its value set to something else and the text set to the actual value. Now I'm having a problem to get this selected text back.
>
>I tried
>return this.ddlSchool.Items[this.ddlSchool.SelectedIndex].Text ;
>// but it returns the original value, not the actual selected text
>
>What could be the problem?
>
>I also have onchange attribute set to
>
>string script = "ChangePhone('" + this.lblSchoolPhone.ClientID + "', this.options[this.selectedIndex].value)";
>
> this.ddlSchool.Attributes.Add("onchange", script);
>
>Could it be that having onchange JavaScript event somehow interferes with the value? It should not be.
>
>Any ideas welcomed because it's late and I need to get it done ASAP.
>
>Thanks in advance.
If it's not broken, fix it until it is.
My Blog