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