html - Display Value of a chossen ListItem from a DropDownList in VB -


i'm using vb , have dropdownlist want value displayed integer. if user chooses 15, display 'size: 300'

    <asp:dropdownlist id="applist" runat="server" autopostback="true" width="110px">         <asp:listitem value="1000">15-1</asp:listitem>         <asp:listitem value="500">15-2</asp:listitem>         <asp:listitem value="300">15</asp:listitem>     </asp:dropdownlist> 

size:

the simplest option use code render block display selected value:

size: <%= applist.selectedvalue %> 

of course, there plenty of other options. e.g. use label data-binding expression, require call page.databind():

size: <asp:label runat="server" text="<%# applist.selectedvalue %>" />  ' in code-behind protected sub page_load(byval sender object, byval e system.eventargs) handles me.load     page.databind() end sub 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -