Microsoft
Software
Hardware
Network
Question : asp.net How to bind a state dropdownlist?
I have this TextBox that I want to replace with dropdownlist
. <asp:TextBox ID="State" Width="80" runat="server" Text='<%# Bind("State") %>'></asp:TextBox>
But how do I bind the value selected to the State selected?
<asp:DropDownList ID="DropDownList2" runat="server" >
<asp:ListItem Value="AK">Alaska</asp:Lis
tItem>
<asp:ListItem Value="AL">Alabama</asp:Li
stItem>
<asp:ListItem Value="AR">Arkansas</asp:L
istItem>
<asp:ListItem Value="AZ">Arizona</asp:Li
stItem>
<asp:ListItem Value="CA">California</asp
:ListItem>
<asp:ListItem Value="CO">Colorado</asp:L
istItem>
<asp:ListItem Value="CT">Connecticut</as
p:ListItem
>
<asp:ListItem Value="DC">District of Columbia</asp:ListItem>
<asp:ListItem Value="DE">Delaware</asp:L
istItem>
<asp:ListItem Value="FL">Florida</asp:Li
stItem>
<asp:ListItem Value="GA">Georgia</asp:Li
stItem>
<asp:ListItem Value="HI">Hawaii</asp:Lis
tItem>
<asp:ListItem Value="IA">Iowa</asp:ListI
tem>
<asp:ListItem Value="ID">Idaho</asp:List
Item>
<asp:ListItem Value="IL">Illinois</asp:L
istItem>
<asp:ListItem Value="IN">Indiana</asp:Li
stItem>
<asp:ListItem Value="KS">Kansas</asp:Lis
tItem>
<asp:ListItem Value="KY">Kentucky</asp:L
istItem>
<asp:ListItem Value="LA">Louisiana</asp:
ListItem>
<asp:ListItem Value="MA">Massachusetts</
asp:ListIt
em>
<asp:ListItem Value="MD">Maryland</asp:L
istItem>
<asp:ListItem Value="ME">Maine</asp:List
Item>
<asp:ListItem Value="MI">Michigan</asp:L
istItem>
<asp:ListItem Value="MN">Minnesota</asp:
ListItem>
<asp:ListItem Value="MO">Missouri</asp:L
istItem>
<asp:ListItem Value="MS">Mississippi</as
p:ListItem
>
<asp:ListItem Value="MT">Montana</asp:Li
stItem>
<asp:ListItem Value="NC">North Carolina</asp:ListItem>
<asp:ListItem Value="ND">North Dakota</asp:ListItem>
<asp:ListItem Value="NE">Nebraska</asp:L
istItem>
<asp:ListItem Value="NV">Nevada</asp:Lis
tItem>
<asp:ListItem Value="NH">New Hampshire</asp:ListItem>
<asp:ListItem Value="NJ">New Jersey</asp:ListItem>
<asp:ListItem Value="NM">New Mexico</asp:ListItem>
<asp:ListItem Value="NY">New York</asp:ListItem>
<asp:ListItem Value="OH">Ohio</asp:ListI
tem>
<asp:ListItem Value="OK">Oklahoma</asp:L
istItem>
<asp:ListItem Value="OR">Oregon</asp:Lis
tItem>
<asp:ListItem Value="PA">Pennsylvania</a
sp:ListIte
m>
<asp:ListItem Value="RI">Rhode Island</asp:ListItem>
<asp:ListItem Value="SC">South Carolina</asp:ListItem>
<asp:ListItem Value="SD">South Dakota</asp:ListItem>
<asp:ListItem Value="TN">Tennessee</asp:
ListItem>
<asp:ListItem Value="TX">Texas</asp:List
Item>
<asp:ListItem Value="UT">Utah</asp:ListI
tem>
<asp:ListItem Value="VA">Virginia</asp:L
istItem>
<asp:ListItem Value="VT">Vermont</asp:Li
stItem>
<asp:ListItem Value="WA">Washington</asp
:ListItem>
<asp:ListItem Value="WI">Wisconsin</asp:
ListItem>
<asp:ListItem Value="WV">West Virginia</asp:ListItem>
<asp:ListItem Value="WY">Wyoming</asp:Li
stItem>
</asp:DropDownList>
Answer : asp.net How to bind a state dropdownlist?
Replace "txtTrainSessionNo" in this string with "cmbTrainSessionNo", i.e. to the name of Combobox.
Alex
Random Solutions
import product catalog from iceCat to VirtualMart
Question about Exchange 2010 mailbox move.
Mount CD on ESXI 4
can't transfare only on zone (on-authoritative answer )
Trouble with a Okidata Microline 395 printer
file share
Somebody knows about this error: delphi Internal Error BC2241 ?
XP runs slow error 0XC000005e,The Security System detected an attempted downgrade attack for server
Will there be a 13" Macbook with an iCore processor anytime soon? Safe to buy C2D?
Cant install fonts on a Mac