1.mvc中url传递多个参数不能直接使用&,会报错(从客户端(&)中检测到有潜在危险的 Request.Path 值

方法①:使用?---/Home/Index/?id=xxx&name=xxx(js:"/MsgTypeTem/Edit/? + Math.random())

方法②:修改路由规则---

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapRoute(
                "Default", // 路由名称
                "{controller}/{action}/{uid}_{token}_{others}.html", // 带有参数的 URL
                new { controller = "Home", action = "Index", uid = UrlParameter.Optional, token = UrlParameter.Optional,others = UrlParameter.Optional} // 参数默认值
            );

相关文章: