473,378 Members | 1,134 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,378 software developers and data experts.

Question on dropdownlist

Hi, I need a dropdownlist to select month from 1 to 12. Is there a way that
I don't need to databind with a database table? cos i just feel a little
stupid to create a Month table have int from 1 to 12 in it.

Nov 17 '05 #1
2 1176
Hi Tony,

Select the DropDownList, press F4, click the "..." on the Items property and
add your items there.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.

"Tony" <gd****@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi, I need a dropdownlist to select month from 1 to 12. Is there a way that I don't need to databind with a database table? cos i just feel a little
stupid to create a Month table have int from 1 to 12 in it.

Nov 17 '05 #2
You can use the DropDownList.Items.Add method to add the months at run time.
Here's more info and an example:
http://msdn.microsoft.com/library/de...classtopic.asp

Or you could just add the values to your HTML at design time.
Here's more info and an example:
http://msdn.microsoft.com/library/de...ClassTopic.asp

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net

"Tony" <gd****@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi, I need a dropdownlist to select month from 1 to 12. Is there a way that I don't need to databind with a database table? cos i just feel a little
stupid to create a Month table have int from 1 to 12 in it.

Nov 17 '05 #3

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

Similar topics

2
by: Newbie | last post by:
I have a C# asp.net webform that contains a dropdownlist and a button that allows the user to select another item in the dropdownlist. The webform should work as follows: When the user selects...
1
by: | last post by:
Hi All I have a form in which i build a table for a series of twenty questions, like a survey questionaire. I use the following function in a user control to create the DropdownList from the...
1
by: Miguel Dias Moura | last post by:
Hello, i need to insert 2 things in a web site form: 1. 3 DropDownLists with Day, Month and Year (since 1920). I don't want to fill everything. Do you know if there is something i can use and...
1
by: Moshfegh Hamedani | last post by:
Hi there, I found this question in Amit Kalani's preparation book for exam 70-15 (Developing Web Applications with C#). I think it's a very stupid question! It says the correct answer is A but...
0
by: Moshfegh Hamedani | last post by:
Hi there, I found this question in Amit Kalani's preparation book for exam 70-15 (Developing Web Applications with C#). I think it's a very stupid question! It says the correct answer is A but...
4
by: Eric | last post by:
I'm trying to reproduce the following table layout using CSS only and am having some trouble with it. I'd like them to look identical but I'm having trouble sizing the labels properly as it doesnt...
1
by: strout | last post by:
I know it's dumb ... sometimes frustrating I want the text and a dropdownlist align with both side of a table cell, i.e. text align left and dropdownlist align right. I cannot add more cells to...
1
by: Phil | last post by:
I would like to make the CreateUserWizard's security question box display as a databound (xml file) dropdownlist. I can make the dropdownlist display by using a contenettemplate, but I can't get...
1
by: DJ | last post by:
I have a DropDownList in Visual Web Developer that is databound to a SQL Database. Whenever the web page is opened the DropDownList is automatically filled with the first item in the table. My...
3
by: RSH | last post by:
I have a simple question regarding inheritance in a web form. I have a DropDownList in an aspx form. It is called DropDownList1 I have a class that will be overriding the render event so I...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.