每次 会话超时的时候 ,当再次登录 就会跳到小的框架中 
我在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");
        }
    }

解决方案 »

  1.   

    LZ时不是使用IFRAME后 然后再登陆就在右边的框架里了?
      

  2.   

    如果是的话 用这种跳转方式   
    window.top.location.href=location.href;   或者直接登陆整个页面。
      

  3.   

    <span class="style9 style12"><a href="UserInfo.aspx" style="text-decoration: none;"
     target="ifr">系统用户信息</a></span>我点击的是a标签跳转的  这样怎么改哈 
      

  4.   

    你这个<a>跳转就是在id name为ifr的iframe的中显示的页面为UserInfo.aspx.
    这个<a>在什么位置还是有讲究的。可以用js来做。
    你的代码最好能贴全一点
      

  5.   

    <iframe id="ifr" runat="server" name="ifr" border="0" frameborder="0" marginwidth="0"
    marginheight="0" scrolling="no" width="100%" src="HTMLPage.htm" height="800px"></iframe>对框架什么都不懂 。。这是框架
      

  6.   

    <iframe id="ifr" runat="server" name="ifr" border="0" frameborder="0" marginwidth="0"
    marginheight="0" scrolling="no" width="100%" src="HTMLPage.htm" height="800px"></iframe>
    里面还有runat="server" 不知要干什么 
    iframe就相当于一个放页面的容器,你这个iframe初始放的页面是HTMLPage.htm
      

  7.   

     是的
    这个是从别人那里拿过来的 公司很老的框架 到现在没人更新。。不知道有什么用
    当我从登陆页面进来的时候 就是HTMLPage.htm 页面 
      

  8.   

    HTMLPage.htm 页面分两块 左边是导航 就是那个a标签 
      

  9.   

    <a href="UserInfo.aspx" style="text-decoration: none;"
     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";
    }
      

  10.   

    在BaserPage里判断  
    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>");
      }
      }
      

  11.   

    在你登录的页面中Login.aspx加入
    <script>
    if(top!=window) top.location.href=window.location.href
    </script>
      

  12.   

    用这个<iframe id="ifr" runat="server" name="ifr" border="0" frameborder="0" marginwidth="0"
    marginheight="0" scrolling="no" width="100%" src="HTMLPage.htm" height="800px"></iframe>