Extension d'assistance MVC
-
19-08-2019 - |
Question
pourquoi ai-je le message d'erreur " Classe, interface, énumération ou structure attendue " avec une chaîne soulignée?
public static string IsSelected(this HtmlHelper helper, string A, string B)
{
return "wtf";
}
La solution
Votre méthode d'extension doit être à l'intérieur d'une classe statique:
public static class MyExtensions
{
public static string IsSelected( this HtmlHelper helper, string A, string B)
{
return "wtf";
}
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow