473,320 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1160
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
1
by: middletree | last post by:
For an ASp Intranet app, I have some code that should work, but I am not able to make it happen for some reason, after spending considerable time on this. I am pretty thick when it comes to...
20
by: Dannyboyo | last post by:
I have what I hope is a simple request. I can't really code in javascript, but I am pretty good at cusomizing it with slight modifications. I code in ASP and HTML. I am trying to capture customer...
5
by: Nick Calladine | last post by:
Learning : Loop to list all dropdown box values on a form Can some one point me in the right direction : I have a form which I want to loop through I basically want to get all the selected...
6
by: passion_to_be_free | last post by:
This is probably simple, but I can't seem to find it anywhere. I have have some values stored in javascript variables. I have a <select> dropdown list whose options correspond to these values. I...
1
by: johngilmer | last post by:
I have a dropdown list where the text that the user sees is unique, but the values behind the options in the list are not unique. So the text/value pairs in the list might be: a - 1 b - ...
2
by: cpptutor2000 | last post by:
Could some PHP guru please help me? I am creating a dynamic dropdown list using a code snippet(Section A) as below: Section A: $sql_query=mysql_query("SELECT DISTINCT semester, year from...
8
by: sheldonlg | last post by:
I am still improving my AJAX and I ran into something that I'm not sure how to do. I will have a page called where I will have a dropdown list at the top and a large display at the bottom. The...
4
by: zion4ever | last post by:
Hello good people, Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.