mvc 获取路由信息(RouteConfig配置的mvc请求地址,不是路由器)

 <div>
        <%
            var html = "";
            foreach (KeyValuePair<string, object> d in RouteData.Values)
            {
                html += d.Key + "=" + (d.Value ?? string.Empty) + "<br/>";
            }
           
        %>
        <%=html %>
    </div>

 

运行结果

controller=Home
action=Index

posted @ 2020-10-05 21:23  小九家的丫头  阅读(203)  评论(0编辑  收藏  举报