//获取请求网址,非法请求,返回主页 if (Request.UrlReferrer != null) { string requstUrl = Request.UrlReferrer.AbsolutePath.ToString(); if (requstUrl != "/Goods/SubmitOrder.aspx") { Response.Redirect("../Activity/Default.aspx"); } } else { Response.Redirect("../Activity/Default.aspx"); }