Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...