By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,857 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,857 IT Pros & Developers. It's quick & easy.

Display the text part of a dropdown list

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.