>Hi everybody,
>
>I am having this error in run-time:
>
>Compilation Error
>Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
>
>Compiler Error Message: CS1502: The best overloaded method match for 'string.Format(string, object)' has some invalid arguments
>
>Source Error:
>
>
>
>Line 1: @model DateTime?
>Line 2:
>Line 3: @Html.TextBox("", String.Format("{0:d}", Model.Value.ToShortDateString),
>Line 4: new { @class = "datefield", type = "date" })
>Line 5:
>
>
>
>I am trying to create the Editor using this code
>
>
>@model DateTime?
>
>@Html.TextBox("", String.Format("{0:d}", Model.Value.ToShortDateString),
> new { @class = "datefield", type = "date" })
>
>
>
>My problems seem to be related to the fact I am using nullable dates. What do I need to do to fix it?
>
>Thanks in advance.
Also, why does it try to use this overload instead of String.Format (string, string)?
If it's not broken, fix it until it is.
My Blog