一、使用javascript清空輸入框的歷史記錄
其實就是防止自動記憶密碼的問題
<!-- 單個控制 --> <input type="text" autocomplete="off"> <!-- 表單整體控制 --> <form autocomplete = "off"> <input type="text"> </form>
二、登錄頁面iframe嵌套
JS處理方法
<script language="JavaScript"> //判斷當前窗口是否有頂級窗口,如果有就讓當前的窗口的地址欄發生變化, //這樣就可以讓登陸窗口顯示在整個窗口了 function loadTopWindow(){ if (window.top!=null && window.top.document.URL!=document.URL){ window.top.location= document.URL; } } </script> </head> <!--在body的寫上onload事件要調用的方法--> <body onload="loadTopWindow()">
MVC下處理方法
后台跳轉到登錄頁嵌套在iframe的問題(MVC例)
//首頁 public ActionResult Index() { if (!Request.IsAuthenticated) //判斷權限,沒有登錄就跳回登錄頁 {string url = Url.Action("Index", "Start", new { area=""}); Response.Write("parent.window.location.href('" + url + "');"); } return View(); }
參考:
https://www.cnblogs.com/jiandankuaile/p/7799856.html
