Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get the Selected text value (not the SelectedValu
Message
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01335710
Message ID:
01335721
Vues:
14
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform