在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
string hiddenToken = "hiddenToken"; public void OnActionExecuting(ActionExecutingContext filterContext) { string httpMethod = filterContext.RequestContext.HttpContext.Server.HtmlEncode(filterContext.RequestContext.HttpContext.Request.HttpMethod); if (httpMethod == "POST") { // page token // hiddenToken string cacheToken = filterContext.HttpContext.Request[hiddenToken]; //filterContext.HttpContext.Request.IsAjaxRequest() if (cacheToken != null) { if (System.Web.HttpContext.Current.Cache[cacheToken] == null) { System.Web.HttpContext.Current.Cache.Insert(cacheToken, cacheToken, null, DateTime.MaxValue, TimeSpan.FromSeconds(1)); LogHeper.Instant.log.Info("提交成功!"); } else { LogHeper.Instant.log.Info(filterContext.HttpContext.Request.Url + "请不要重复提交!"); throw (new GLRISCRMException("请不要重复提交!")); } } } }
@Html.Hidden("hiddenToken", new Guid().ToString() + DateTime.Now.Ticks)
|
请发表评论