Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error
Message
 
 
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Titre:
Re: Error
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01552060
Message ID:
01552061
Vues:
40
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform