每次 会话超时的时候 ,当再次登录 就会跳到小的框架中
我在Global.asax 中加了这个没有效果 请问怎样才能。。
void Session_Start(object sender, EventArgs e)
{
// 在新会话启动时运行的代码
Uri url = System.Web.HttpContext.Current.Request.Url;
string fileName = url.Segments[url.Segments.Length - 1];
if (fileName != "Default.aspx")
{
Response.Redirect("Default.aspx");
}
}
window.top.location.href=location.href; 或者直接登陆整个页面。
target="ifr">系统用户信息</a></span>我点击的是a标签跳转的 这样怎么改哈
这个<a>在什么位置还是有讲究的。可以用js来做。
你的代码最好能贴全一点
marginheight="0" scrolling="no" width="100%" src="HTMLPage.htm" height="800px"></iframe>对框架什么都不懂 。。这是框架
marginheight="0" scrolling="no" width="100%" src="HTMLPage.htm" height="800px"></iframe>
里面还有runat="server" 不知要干什么
iframe就相当于一个放页面的容器,你这个iframe初始放的页面是HTMLPage.htm
这个是从别人那里拿过来的 公司很老的框架 到现在没人更新。。不知道有什么用
当我从登陆页面进来的时候 就是HTMLPage.htm 页面
target="ifr">系统用户信息</a>
这个<a>里面的写法要做些改变了。
本身你的框架包含的页面是HTMLPage.htm,点击后可直接在这个ifr里面刷新,改target="_self"就可以
要是你希望在HTMLPage.htm的上面刷新,那么你需要的包含ifr这个iframe的页面里面,在你希望的位置放置一个iframe,然后改写这个<a>
<a href="javascript:void(0);" style="text-decoration: none;" onclick="ShowLogin();">
系统用户信息</a>
在
HTMLPage.htm里面添加js方法function ShowLogin()
{
window.parent.document.getElementById("loginframe").src="UserInfo.aspx";
}
public class BasePage : System.Web.UI.Page
{
public BasePage()
{
}
protected override void OnInit(EventArgs O)
{
if (base.Session["UserId"] == null || base.Session["UserId"].ToString().Equals(""))
{
Response.Redirect("~/Error.aspx");
}
}
}
public partial class Error : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("<script>top.location.href='login.aspx';</script>");
}
}
<script>
if(top!=window) top.location.href=window.location.href
</script>
marginheight="0" scrolling="no" width="100%" src="HTMLPage.htm" height="800px"></iframe>