469,929 Members | 1,407 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

question reagrding dropdown list option values

HI There,

I would like to find out the syntax for having option values different from
the ones displayed on the page? In regular HTML the forms are like
<option value=1>New South Wales</option>, how can I acheive this in asp
..net?

Sean

!---

<ASP:DropDownList id=lstRegion name=lstRegion maxlength= "40" runat=server>
<asp:ListItem>New South Wales</asp:ListItem>
<asp:ListItem>Victoria</asp:ListItem>
<asp:ListItem>Tasmania</asp:ListItem>
<asp:ListItem>South Australia</asp:ListItem>
<asp:ListItem>Western Australia</asp:ListItem>
<asp:ListItem>Northern Territory</asp:ListItem>
<asp:ListItem>Queensland</asp:ListItem>
</ASP:DropDownList>
Nov 18 '05 #1
2 1083
Hi Sean,

You can put the value in as an attribute like this:

<ASP:DropDownList id="lstRegion" name="lstRegion" maxlength="40"
runat="server">
<asp:ListItem Value="NSW">New South Wales</asp:ListItem>
<asp:ListItem Value="V">Victoria</asp:ListItem>
<asp:ListItem Value="T">Tasmania</asp:ListItem>
<asp:ListItem Value="SA">South Australia</asp:ListItem>
<asp:ListItem Value="WA">Western Australia</asp:ListItem>
<asp:ListItem Value="NT">Northern Territory</asp:ListItem>
<asp:ListItem Value="Q">Queensland</asp:ListItem>
</ASP:DropDownList>

Does this help?

Ken
Microsoft MVP [ASP.NET]
Toronto

"Sean" <se**********@shopsmart.com.au> wrote in message
news:ud**************@TK2MSFTNGP12.phx.gbl...
HI There,

I would like to find out the syntax for having option values different
from
the ones displayed on the page? In regular HTML the forms are like
<option value=1>New South Wales</option>, how can I acheive this in asp
.net?

Sean

!---

<ASP:DropDownList id=lstRegion name=lstRegion maxlength= "40"
runat=server>
<asp:ListItem>New South Wales</asp:ListItem>
<asp:ListItem>Victoria</asp:ListItem>
<asp:ListItem>Tasmania</asp:ListItem>
<asp:ListItem>South Australia</asp:ListItem>
<asp:ListItem>Western Australia</asp:ListItem>
<asp:ListItem>Northern Territory</asp:ListItem>
<asp:ListItem>Queensland</asp:ListItem>
</ASP:DropDownList>


Nov 18 '05 #2
Thanks Ken.
"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Sean,

You can put the value in as an attribute like this:

<ASP:DropDownList id="lstRegion" name="lstRegion" maxlength="40"
runat="server">
<asp:ListItem Value="NSW">New South Wales</asp:ListItem>
<asp:ListItem Value="V">Victoria</asp:ListItem>
<asp:ListItem Value="T">Tasmania</asp:ListItem>
<asp:ListItem Value="SA">South Australia</asp:ListItem>
<asp:ListItem Value="WA">Western Australia</asp:ListItem>
<asp:ListItem Value="NT">Northern Territory</asp:ListItem>
<asp:ListItem Value="Q">Queensland</asp:ListItem>
</ASP:DropDownList>

Does this help?

Ken
Microsoft MVP [ASP.NET]
Toronto

"Sean" <se**********@shopsmart.com.au> wrote in message
news:ud**************@TK2MSFTNGP12.phx.gbl...
HI There,

I would like to find out the syntax for having option values different
from
the ones displayed on the page? In regular HTML the forms are like
<option value=1>New South Wales</option>, how can I acheive this in asp
.net?

Sean

!---

<ASP:DropDownList id=lstRegion name=lstRegion maxlength= "40"
runat=server>
<asp:ListItem>New South Wales</asp:ListItem>
<asp:ListItem>Victoria</asp:ListItem>
<asp:ListItem>Tasmania</asp:ListItem>
<asp:ListItem>South Australia</asp:ListItem>
<asp:ListItem>Western Australia</asp:ListItem>
<asp:ListItem>Northern Territory</asp:ListItem>
<asp:ListItem>Queensland</asp:ListItem>
</ASP:DropDownList>

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by middletree | last post: by
20 posts views Thread by Dannyboyo | last post: by
6 posts views Thread by passion_to_be_free | last post: by
2 posts views Thread by cpptutor2000 | last post: by
8 posts views Thread by sheldonlg | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.