Dear Friend
when you are using the asp.net calender in your application you will by default it returns 01/01/0001 in your Calendar1.SelectedDate or Calendar1.VisibleDate
for returning the correct date you need to
This is a reported bug with a workaround: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=110750
Inspecting the Calendar.VisibleDate or Calendar1.SelectedDate property the first time a page is rendered always gives: 1/1/0001 12:00:00 AM. If you navigate to the next or previous month, then the Calendar.Visible or Calendar1.SelectedDate Date property is correct.when you are using the asp.net calender in your application you will by default it returns 01/01/0001 in your Calendar1.SelectedDate or Calendar1.VisibleDate
for returning the correct date you need to
This is a reported bug with a workaround: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=110750
Solution
In the Page_Load, place the following code:
If Not Page.IsPostBack Then
Calendar1.SelectedDate = Today
End If
Regards
Rashid Bilgrami
CEO Best visualization
http://www.bestvisualization.com
This is a nice article..
ReplyDeleteIts very easy to understand ..
And this article is using to learn something about it..
c#, dot.net, php tutorial
Thanks a lot..!
thanks for liking it,
ReplyDeleteGood information on ASP.net Calender. I was not aware of this. But, your article has doubled my knowledge in it. Really interesting. Thanks for sharing.
ReplyDeleteAlways welcome :)
ReplyDelete