Click here to Skip to main content
16,019,618 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
Hi,
I want to display weekday on label control using date from calender control.
How to do that. Any solution.
Posted
Updated 31-Jan-11 10:28am
v2

1 solution

Check this[^] out.
Once you have the DateTime value from the calendar control you just need to get the .DayOfWeek property (0-6) and convert it to a literal day. Apply that to your label and you are done.
 
Share this answer
 
Comments
Espen Harlinn 31-Jan-11 16:37pm    
Good answer, 5+
Sergey Alexandrovich Kryukov 31-Jan-11 16:45pm    
Agree - my 5.
--SA
Rohit.Net100 31-Jan-11 20:04pm    
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
DateTime SelectedDeate = Calendar1.SelectedDate;
Label1.Text = SelectedDeate.DayOfWeek.ToString();
}
fjdiewornncalwe 1-Feb-11 10:38am    
+5 for your question because you have completed the circle by providing the solution back to the community. Well done, good sir.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900