1

为什么我会收到错误“Expected class, interface, enum or struct”,字符串下划线?

 public static string IsSelected(this HtmlHelper helper, string A, string B)

    {
         return "wtf";

    }
4

1 回答 1

6

您的扩展方法需要在静态类中:

public static class MyExtensions
{
    public static string IsSelected( this HtmlHelper helper, string A, string B)
    {
        return "wtf";

    }
}
于 2009-01-21T21:24:52.003 回答