MVC 日常所用

it2022-05-05  177

1、web.config中的runAllManagedModulesForAllRequests属性

runAllManagedModulesForAllRequests 在ASP.net中的web.config中,modules的这个属性比较重要。由于是在Global.ascx中,如想对每个Request都 执行Application_BeginRequest,那么必须要在system.web或system.webServer中的modules中加入 此属性: <modules runAllManagedModulesForAllRequests="true"> View Code

2、直接跳转至部分视图

@Html.Partial("action","contiol",new viewdatadictionary{{“传值参数1”,1},{“传值参数2”,2}})

3、访问部分视图控制器

@Html.Action("action","contiol",传值参数1)

转载于:https://www.cnblogs.com/eric-gms/p/4040946.html


最新回复(0)