- 调用当前Controller中的方法
1 @{ 2 ((HomeController)ViewContext.Controller).Method1(); 3 }
- 调用静态方法
1 @{ 2 SomeClass.Method(); 3 }
1 @{ 2 ((HomeController)ViewContext.Controller).Method1(); 3 }
1 @{ 2 SomeClass.Method(); 3 }
转载于:https://www.cnblogs.com/sunshineground/p/4380122.html