注销代码不适用于 Jquery 验证
本文关键字:Jquery 验证 适用于 不适用 代码 注销 | 更新日期: 2023-09-27 18:33:02
注销代码不适用于具有Jquery验证的WebForms。相同的注销代码适用于没有任何验证的其他表单。注销代码为
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
Response.Expires = -1500;
Response.CacheControl = "no-cache";
Session.Clear(); //clear session
Session.Abandon();//Abandon session
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
Response.Redirect("~/Index.aspx");
和 Jquery 验证代码
$(function () {
$("#form1").validationEngine('attach', { promptPosition: "topRight" });
});
添加了这些链接
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://cdn.ucb.org.br/Scripts/formValidator/js/languages/jquery.validationEngine-en.js"
charset="utf-8"></script>
<script type="text/javascript" src="http://cdn.ucb.org.br/Scripts/formValidator/js/jquery.validationEngine.js"
charset="utf-8"></script>
并且一些CSS代码也用于这些Web表单
谁能帮我?
通过在每个 Web 表单中使用此代码来解决 PageLoad 事件
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();