asp.net - VB.net dropdown list value populated in variable rather than text -


i have dropdown list populated follows:

<asp:dropdownlist id="ddlsubgroup" runat="server" cssclass="dropdown" style="font-size: 11px" autopostback="true">         <asp:listitem selected="true">select all</asp:listitem>         <asp:listitem value="genf">girls</asp:listitem>         <asp:listitem value="genm">boys</asp:listitem> -----snip 

in page load procedure have declared variable , use variable update contents of label:

protected sub page_load(sender object, e eventargs) handles me.load     dim strsubgroup string = ddlsubgroup.text      lblheadersubroup.text = " " & strsubgroup 

however, results in dropdown listitem value eg "genf" displaying in label , not text eg girls expected.

try referring lblheadersubroup.selecteditem.text property instead of object itself.

this you're experiencing issue.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -