Last post Nov 16, 2013 07:30 PM by mallorz
Nov 16, 2013 02:18 PM|mallorz|LINK
I am using the Calendar control in asp.net to determine the arrival/departure dates on a form. I'd like to be able to tell what day of the week was selected in addition to the date. How would this be done? I have never used this control before and can't
seem to find a good help document online. FYI, code-behind is in c#.
Nov 16, 2013 02:26 PM|A2H|LINK
You can use Calendar
SelectedDate property to get name of selected day
Try using the below code to get day names of selected date in calendar
//Get the selected day name from calendar control
string selectedDayname = Calendar1.SelectedDate.DayOfWeek.ToString();
<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
Nov 16, 2013 02:34 PM|mallorz|LINK
Simple enough! I suppose I would have seen that it I would have began the code.
Thanks for the quick reply.
Nov 16, 2013 07:30 PM|mallorz|LINK
I can't really move on until I figure this out. Hopefully someone can help me or this day will be wasted.
In relation to this - let's say the user is staying for 5 days, Thursday-Monday. I referred to an old program of mine to calculate the days of stay, but let's say there is a different rate between weekdays and weekends - Is there a way to differentiate between
the two within that 5 day range?