I have looked all over the net and I can't find help on doing the following routine.I am trying use a dropdownlist to output the days of a month using asp.net and c#. Let me know if you need any more information.I have been able to implement the years and months using dropdownlists.
asp.net and dropdownlist for days of month
Page 1 of 12 Replies - 793 Views - Last Post: 19 July 2012 - 04:34 PM
Replies To: asp.net and dropdownlist for days of month
#2
Re: asp.net and dropdownlist for days of month
Posted 19 July 2012 - 04:28 PM
what have you tried so far to get the days working? Where's your code? What errors are you getting, if any?
#3
Re: asp.net and dropdownlist for days of month
Posted 19 July 2012 - 04:34 PM
here is the code I am working with.
I have almost figured it out,thanks for all the help.
if (!IsPostBack)
{
int year = System.DateTime.Now.Year;
for (int intCount = 1900; intCount <= year; intCount++)
{
DropDownList2.Items.Add(intCount.ToString());
}
int month = System.DateTime.Now.Month;
int day = System.DateTime.DaysInMonth(year, month);
for (int intCount = 1; intCount <= day; intCount++)
{
DropDownList3.Items.Add(intCount.ToString());
}
}
I have almost figured it out,thanks for all the help.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|