zsh*_*arp 1 asp.net-mvc extension-methods html-helper
为什么我用字母串下划线得到错误"Expected class,interface,enum or struct"?
public static string IsSelected(this HtmlHelper helper, string A, string B)
{
return "wtf";
}
Run Code Online (Sandbox Code Playgroud)
您的扩展方法需要在静态类中:
public static class MyExtensions
{
public static string IsSelected( this HtmlHelper helper, string A, string B)
{
return "wtf";
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
974 次 |
| 最近记录: |