Ramco Ramco

Ramco Ramco

  • 442
  • 3.4k
  • 517.1k

Error - Unable to cast object of type 'System.Web.UI.WebControls

May 28 2023 4:37 PM

Hi

  I am getting error - Unable to cast object of type 'System.Web.UI.WebControls.HiddenField' to type 'System.IConvertible'.

HiddenField hdfDate = ((HiddenField)e.Item.FindControl("hdfDate"));
<asp:HiddenField ID="hdfDate" runat="server" Value='<%# Eval("SessionDate") %>' />

Thanks


Answers (3)