2014-12-04 64 views
0

注销代码不适用于具有Jquery验证的WebForms。对于没有任何验证的其他表单,相同的注销代码正常工作。登出代码注销代码不能与Jquery验证一起使用

   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代码在这些网站还使用形成

可以任何人都帮助我?

回答

0

解决在每一个网站形式pageLoad的事件使用此代码

  Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1)); 
      Response.Cache.SetCacheability(HttpCacheability.NoCache); 
      Response.Cache.SetNoStore();