Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error
Message
 
General information
Forum:
ASP.NET
Category:
MVC
Title:
Re: Error
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01552060
Message ID:
01552061
Views:
41
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform