Ramco Ramco

Ramco Ramco

  • 443
  • 3.4k
  • 526.9k

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)