Connecting Tech Pros Worldwide Forums | Help | Site Map

Question on dropdownlist

Tony
Guest
 
Posts: n/a
#1: Nov 17 '05
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.




Victor Garcia Aprea [MVP]
Guest
 
Posts: n/a
#2: Nov 17 '05

re: Question on dropdownlist


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" <gdxing@hotmail.com> wrote in message
news:%23djo9A0SDHA.3768@tk2msftngp13.phx.gbl...[color=blue]
> Hi, I need a dropdownlist to select month from 1 to 12. Is there a way[/color]
that[color=blue]
> 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.
>
>
>[/color]


Steve C. Orr, MCSD
Guest
 
Posts: n/a
#3: Nov 17 '05

re: Question on dropdownlist


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" <gdxing@hotmail.com> wrote in message
news:%23djo9A0SDHA.3768@tk2msftngp13.phx.gbl...[color=blue]
> Hi, I need a dropdownlist to select month from 1 to 12. Is there a way[/color]
that[color=blue]
> 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.
>
>
>[/color]


Closed Thread