473,508 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display the text part of a dropdown list

tfs
I have a dropdownlist:

<asp:dropdownlist id="recurrance" runat="server">
<asp:listitem value="0" >None</asp:listitem>
<asp:listitem value="1" >Daily</asp:listitem>
<asp:listitem value="2" >Weekly</asp:listitem>
<asp:listitem value="3" >Monthly</asp:listitem>
<asp:listitem value="4" >Yearly</asp:listitem>
</asp:dropdownlist>
I have these stored as the values.

How do I easily display the text portion on my web page (not the
value), so that if I have a value of "3" that I got from my Sql
database, I will display "Monthly". I also want it to display on one
page as the the dropdown and on another page as only text, with no
borders.

Thanks,

Tom.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 18 '05 #1
1 1406
I believe that the SelectedItem property will provide you with what you are
looking for.

http://msdn.microsoft.com/library/de...ditemtopic.asp

--
------------------------
Chris Darnell
Homepage: http://www.darnellc.com
Weblog: http://journals.aol.com/csdarnell/ChrisDarnellsBlog
"tfs" <tf*@dslextreme-dot-com.no-spam.invalid> wrote in message
news:40**********@Usenet.com...
I have a dropdownlist:

<asp:dropdownlist id="recurrance" runat="server">
<asp:listitem value="0" >None</asp:listitem>
<asp:listitem value="1" >Daily</asp:listitem>
<asp:listitem value="2" >Weekly</asp:listitem>
<asp:listitem value="3" >Monthly</asp:listitem>
<asp:listitem value="4" >Yearly</asp:listitem>
</asp:dropdownlist>
I have these stored as the values.

How do I easily display the text portion on my web page (not the
value), so that if I have a value of "3" that I got from my Sql
database, I will display "Monthly". I also want it to display on one
page as the the dropdown and on another page as only text, with no
borders.

Thanks,

Tom.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4778
by: Corepaul | last post by:
As input is typed into a text box, I would like to search a recordset for the first record that matches what has been typed so far. I would like to update the text box to display the letters typed...
1
1612
by: priyanka.freakout | last post by:
Hi All, In my form I have created a dropdown box which is populated with data from a database on page load and i have also created a dropdwon box and what i intend on doing is displaying data...
0
1335
by: Kay | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
0
1601
by: Kay O'Keeffe | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
2
7035
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
2
2053
by: mervyntracy | last post by:
Hi There, I have recently started coding in asp.net (just 2 and a half days now). I am writing a simple test app that gets data from a data base and displays the value perfectly in the drop down...
8
2869
by: ardhuru | last post by:
Hello, I am a complete newbie with VB, so this question might sound really stupid; please bear with me. My question is, can a combo box be used to display a value in the sense a label can? I...
2
3229
by: wreed06 | last post by:
Hello, I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully...
9
2344
by: arunbojan | last post by:
Hi friends, following is my code //================ if (ddlColumnName.SelectedItem.Text == "call duration") { Label4.Text = "HH:MM:SS";
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.