因为我的应用程序有一个边栏菜单,每次我通过xml动态构建我想加载一个视图我需要通过所有这些参数。有没有更好的方法可以做到这一点?在asp.net mvc
ViewData["mainItems"] = navigation.getItems();
ViewData["controller"] = controller;//this is just a string with the name of my controller
我该如何避免每次都这样做,但参数不断被检索和传递?
我不明白。你是否在每一个请求中设置ViewData,这就是你想要避免的? – 2009-09-15 19:35:48