更好的方式来在asp.net的MVC母版视图中找到控制器名称 [英] better way to find controller name from masterpage view in asp.net mvc
本文介绍了更好的方式来在asp.net的MVC母版视图中找到控制器名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是什么更好的方法来找到控制的名字从母版视图asp.net mvc的?
is any better way to find controller name from masterpage view in asp.net mvc?
谢谢
阿舒。
推荐答案
<一个href=\"http://stackoverflow.com/questions/1083774/getting-the-name-of-the-controller-and-action-method-in-the-view-in-asp-net-mvc\">StackOverflow - 获取控制器和操作方法的名称在ASP.NET MVC的观点:
<%: ViewContext.RouteData.Values["Controller"] %>
<%: ViewContext.RouteData.Values["Action"] %>
这篇关于更好的方式来在asp.net的MVC母版视图中找到控制器名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文