asp.net 退出框架页面时回退至登录界面

一、登录界面设置

<body>
    <form id="form1" runat="server" target="_top">
    <div>

        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Login"
            Width="115px" />
        <asp:Image runat="server" ImageUrl="~/ValidateImage.ashx" />
    </div>
    </form>
</body>

二、退出代码

string url = Request.ApplicationPath + "/Login.aspx";
//Utility.Jscript.alert("本次登录已经超时,请重新登录系统");
Response.Write(" <script>top.location='" + url + "' ;</script>");
Response.End();

原文地址:https://www.cnblogs.com/hzj3099/p/1522328.html