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";

    }
Était-ce utile?

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
scroll top