when i want to change my datetime format i take error.I use this code on view:
@Html.TextBoxFor(model => model.enddate, new { @Value =((DateTime)Model.enddate).ToString(" dd/MM/yyyy"),@class = "input-xlarge datepicker"})
but when i execute Model.enddate is null so i take this error:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Can you help me.
My english is not very well :(