一、使用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