1:
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.pclass = this; // 通过ViewBag把this指针传给视图,
return View();
}
public string f1(int i)
{
int a=i+100;
return a.ToString();
}
}
在视图文件就可以像下面一样调用:
@{ Layout = null;
&nb