Greetings,
I have the following HiddenField
<asp:HiddenField ID="hdfFecha" runat="server" />
and in the code behing I have, to convert it to "dd-MM-yyyy" format.
FormAGPost.Fecha = DateTime.ParseExact(hdfFecha.Value, "dd-MM-yyyy", CultureInfo.InvariantCulture);
But I get an error when converting it. This is the error that gives me:
An exception of type 'System.NullReferenceException' occurred in CentroEntrevista.dll but was not handled in user code Additional information: Object reference not set to an instance of an object.
the value obtained in the variable is: "21-01-2017T00: 00: 00 + 00: 00"