回复 5楼xiyou的帖子@{
var currentUrl = Request.Url.ToString();//获取当前页面地址
if (currentUrl.IndexOf(".cshtml", StringComparison.OrdinalIgnoreCase) < 0 && currentUrl.IndexOf("?") < 0 && !currentUrl.EndsWith("/"))
{
ViewContext.HttpContext.Response.Clear();
ViewContext.HttpContext.Response.RedirectPermanent(currentUrl + "/");
HttpContext.Current.Response.End();
}
}