monfu Posted November 14, 2005 Posted November 14, 2005 Dear All, I have this piece of code:- CType(r.FindControl("calDate"), Calendar).SelectedDate = DateTime.Parse(CType(r.FindControl("txtEvDate"), TextBox).Text()) And its giving me an error:- String was not recognized as a valid DateTime How can I solve this? Thanks for your help and time Johann Quote
Administrators PlausiblyDamp Posted November 14, 2005 Administrators Posted November 14, 2005 What is the contents of txtEvDate? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
monfu Posted November 14, 2005 Author Posted November 14, 2005 Thanks mate I used the following Dim myDate As DateTime = DateTime.ParseExact(CType(r.FindControl("txtEvDate"), TextBox).Text(), "MM/dd/yy", New DateTimeFormatInfo) and its working fine now. Cheers Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.