Specified cast is not valid

  • Thread starter Thread starter David C
  • Start date Start date
D

David C

I have added some Calendar Extenders to a FormView for some of the TextBoxes
holding dates. I am getting a runtime error of "Specified cast is not valid
and it is highlighting the CalendarExtender control. Below is the control
and the extender control. I was wondering if this error is due to the fact
that the date column OnHoldDate) I am binding to is Null? If so, what is a
workaround? Thanks.

David

<asp:TextBox ID="txtRaceID" runat="server" Text='<%# Bind("RaceID") %>'
CssClass="Hide"></asp:TextBox>

<cc1:CalendarExtender ID="CalendarExtender3" runat="server"
TargetControlID="txtOnHoldDate"
SelectedDate='<%# Bind("OnHoldDate") %>'>
</cc1:CalendarExtender>
 
I have added some Calendar Extenders to a FormView for some of the TextBoxes
holding dates.  I am getting a runtime error of "Specified cast is not valid
and it is highlighting the CalendarExtender control.  Below is the control
and the extender control.  I was wondering if this error is due to the fact
that the date column OnHoldDate) I am binding to is Null?  If so, what is a
workaround?  Thanks.

David

<asp:TextBox ID="txtRaceID" runat="server" Text='<%# Bind("RaceID")%>'
CssClass="Hide"></asp:TextBox>

<cc1:CalendarExtender ID="CalendarExtender3" runat="server"
TargetControlID="txtOnHoldDate"
              SelectedDate='<%# Bind("OnHoldDate") %>'>
 </cc1:CalendarExtender>

Hi David,

please look at this post
http://forums.asp.net/t/1262133.aspx

Hope this helps
 
I have added some Calendar Extenders to a FormView for some of the
TextBoxes
holding dates. I am getting a runtime error of "Specified cast is not
valid
and it is highlighting the CalendarExtender control. Below is the control
and the extender control. I was wondering if this error is due to the fact
that the date column OnHoldDate) I am binding to is Null? If so, what is a
workaround? Thanks.

David

<asp:TextBox ID="txtRaceID" runat="server" Text='<%# Bind("RaceID") %>'
CssClass="Hide"></asp:TextBox>

<cc1:CalendarExtender ID="CalendarExtender3" runat="server"
TargetControlID="txtOnHoldDate"
SelectedDate='<%# Bind("OnHoldDate") %>'>
</cc1:CalendarExtender>

Hi David,

please look at this post
http://forums.asp.net/t/1262133.aspx

Hope this helps

It was perfect! Thank you so much.

David
 
Back
Top