2010-12-08 56 views
0

我正在使用示例mvc 2應用程序。在我處理會話超時在web.config下面的代碼是這樣的。會話超時重定向在mvc中的面板2

<authentication mode="Forms"> 
    <forms loginUrl="~/Account/LogOn" cookieless="UseCookies" name="FormAuthentication" timeout="1"/> 
</authentication> 

這是代碼工作正常的畫面時,我不停地在空閒屏幕....

,但我的問題是,在一個特定的屏幕,我有一個面板,如果會話八個選項卡登錄頁面被重定向,空閒階段後,如果我點擊標籤中的鏈接按鈕,它是重定向登錄頁面內的標籤面板不重定向到登錄頁面。所有選項卡已完成與usercontrols參考參考....

回答

0

您需要讓登錄頁面突破任何框架集,因此在登錄頁面的head中添加以下Java腳本:

<script type="text/javascript"> 
if (parent.frames.length > 0) { 
    top.location.href = document.location.href; 
} 
</script> 
+0

我已經在它不是工作 – 2010-12-08 07:59:53

0
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="LogOn.Master.cs" Inherits="System.Web.Mvc.ViewMasterPage" %> 

<head runat="server"> 
    <asp:ContentPlaceHolder ID="head" runat="server"> 
</asp:ContentPlaceHolder> 
<script src="../../Scripts/jquery-1.3.2.min.js" type="text/javascript"></script> 
<link href="../../App_Themes/PropelSkin/Stylesheet1.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="../../Scripts/thickbox-min.js"></script> 
<link rel="Stylesheet" href="../../Css/Thickbox.css" type="text/css" /> 
<script type="text/javascript"> 
    if (parent.frames.length > 0) { 
     top.location.replace(document.location); 
    } 
</script> 

0
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 
<script type="text/javascript"> 

    $(function() { 
     var tabContainers = $('div.tabs > div'); 

     $('div.tabs ul.tabNavigation a').click(function() { 
      tabContainers.hide().filter(this.hash).show(); 

      $('div.tabs ul.tabNavigation a').removeClass('selected'); 
      $(this).addClass('selected'); 

      return false; 
     }).filter(':first').click(); 
    }); 

</script> 
<script src="../../Scripts/ajaxfileupload.js" type="text/javascript"></script> 
<div class="content-admin"> 
    <% 

     EmployeeDetails employeeDetails = null; 
     if (ViewData["EmployeeDetails"] != null) 
      employeeDetails = (EmployeeDetails)ViewData["EmployeeDetails"]; 
     EmployeePersonalDetails personalDetails = null; 
     if (ViewData["PersonalDetails"] != null) 
      personalDetails = (EmployeePersonalDetails)ViewData["PersonalDetails"]; 
     string entityName = new EmployeeDetails().EntityIdentifier; 

     if (employeeDetails != null) 
     { %> 
    <div class="page-header"> 
     <h1> 
      <%=employeeDetails.FirstName%>'s Profile 
     </h1> 
     <%-- column.ForColumn(col => Replace().SetFieldIdentifierAndPermissions("", PrivilegeConstant.DeleteEmployee).Named("Deactivate").DoNotEncode().Attributes(x => new Hash(@style => "font-weight:normal"));--%> 
     <table class="form-search" cellpadding="0" cellspacing="0"> 
      <tr> 
       <td class="gridbg"> 
       </td> 
       <td class="searchbg"> 
        <table> 
         <tr> 
          <% 
           if (!string.IsNullOrEmpty(employeeDetails.UserId)) 
           { 
            if (UserIdentity.HasPrivilege(CelloSaaS.ServiceContracts.AccessControlManagement.PrivilegeConstants.AddUserRole) && 
             UserIdentity.HasPrivilege(CelloSaaS.ServiceContracts.AccessControlManagement.PrivilegeConstants.DeleteUserRole) 
             ) 
            { 

          %> 
          <td> 
           <a class="thickbox" href="AddRoleSettings?width=375&height=245&userId=<%=employeeDetails.UserId %>&employeeId=<%=employeeDetails.Identifier %>" 
            title="Assign Roles" alt="Assign Roles"> 
            <img src="../../App_Themes/PropelSkin/btn-assignroles.png" alt="Assign Roles" /></a> 
          </td> 
          <%} 
           } %> 
          <td> 
           <%--<div class="imageAlign">--%> 
           <a href="../History/History?entityName=<% =entityName %>&entityReferenceId=<%=employeeDetails.Identifier %>" 
            title="View History" alt="View History"> 
            <img src="../../App_Themes/PropelSkin/btn-viewhistory.png" alt="View History" /></a> 
           <%--</div>--%> 
          </td> 
          <% if (UserIdentity.HasPrivilege(PrivilegeConstant.DeleteEmployee)) 
           { %> 
          <td> 
           <a href="DeleteEmployeeDetails?employeeId=<%=employeeDetails.Identifier %>" title="Deactivate Employee" 
            alt="Deactivate Employee"> 
            <img id="deactivateemp" src="../../App_Themes/PropelSkin/btn-deactivate.png" alt="Deactivate Employee" /></a> 
          </td> 
          <%} %> 
          <% if (UserIdentity.HasPrivilege(PrivilegeConstant.ViewEmployee)) 
           { %> 
          <td> 
           <a href="EmployeeList"> 
            <img src="<%= this.ResolveClientUrl("../../App_Themes/PropelSkin/btn-back.png")%>" 
             alt="Back To Employee List" /></a> 
          </td> 
          <%} %> 
         </tr> 
        </table> 
       </td> 
      </tr> 
     </table> 
    </div> 
    <div class="profile-content-cntr"> 
     <div class="profile-content-left"> 
      <div class="profile-header"> 
       <h1> 
        Summary</h1> 
      </div> 
     </div> 
     <div class="profile-content-right"> 
      <div class="tabs"> 
       <ul class="tabNavigation"> 
        <li><a href="#EmployeeDetails" title="Organizational Info"><span>Organization</span></a></li> 
        <li><a href="#ManagePersonalDetails" title="Personal Info"><span>Personal</span></a></li> 
        <li><a href="#EmployeeEducationDetails" title="Education"><span>Education</span></a></li> 
        <li><a href="#EmployeeEmploymentHistory" title="Experience"><span>Experience</span></a></li> 
        <li><a href="#EmployeeCoOrganizationDetails" title="CoOrganizationDetails"><span>Co-Organization</span> 
        </a></li> 
        <li><a href="#EmployeeSkillSet" title="Skils"><span>Skills</span></a></li> 
        <li><a href="#EmployeeDocuments" title="Documents"><span>Documents</span></a></li> 
        <%-- <li><a href="#Skills" title="Skills">Skills</a></li> 
        <li><a href="#Skills" title="Projects">Projects</a></li>--%> 
        <%-- <li><a href="#Skills" title="Leaves">Leaves</a></li>--%> 
        <%--<li><a href="#Skills" title="Payroll">Payroll</a></li>--%> 
       </ul> 
       <a href="#" title="Next" class="imageNaviation"> 
        <img src="../../App_Themes/PropelSkin/arrow-right.png" alt="Next" /> 
       </a><a href="#" title="Previous" class="imageNaviation"> 
        <img src="../../App_Themes/PropelSkin/arrow-left.png" alt="Previous" /></a> 
      </div> 
     </div> 
    </div> 
    <div class="form-content"> 
     <div class="content-left"> 
      <div id="EmployeeBasicDetails" class="profile-view"> 
       <% Html.RenderPartial("ManageEmployeeBasicDetails"); %> 
      </div> 
     </div> 
     <div class="content-right"> 
      <div class="right-panel"> 
       <div class="profile-tabs"> 
        <div class="tabs"> 
         <div id="EmployeeDetails"> 
          <% Html.RenderPartial("ManageEmployeeDetails"); %> 
         </div> 
         <div id="ManagePersonalDetails"> 
          <% Html.RenderPartial("ManagePersonalDetails"); %></div> 
         <div id="EmployeeEducationDetails"> 
          <% Html.RenderPartial("ManageEducationDetails"); %></div> 
         <div id="EmployeeEmploymentHistory"> 
          <% Html.RenderPartial("ManageEmploymentHistory"); %></div> 
         <div id="EmployeeCoOrganizationDetails"> 
          <% Html.RenderPartial("ManageCoOrganizationDetails"); %></div> 
         <div id="EmployeeSkillSet"> 
          <% Html.RenderPartial("ManageEmployeeSkillSet"); %> 
         </div> 
         <div id="EmployeeDocuments"> 
          <% Html.RenderPartial("ManageEmployeeDocuments"); %> 
         </div> 
         <%--<div id="Skills"> 
       <% Html.RenderPartial("Skills"); %> 
      </div> 
      <div id="Skills"> 
       <% Html.RenderPartial("Skills"); %> 
      </div> 
      <div id="Skills"> 
       <% Html.RenderPartial("Skills"); %> 
      </div>--%> 
         <%-- </div>--%> 
        </div> 
       </div> 
      </div> 
      <%} 
     else 
     { %> 
      <div> 
       <div class="profile-view"> 
        <div class="profile-det"> 
         <div class="notification-bg"> 
          <div id="msg-failure"> 
           <div class="header"> 
            <img src="../../App_Themes/PropelSkin/fail-top1.gif" alt="" class="left" /> 
            <img src="../../App_Themes/PropelSkin/fail-top2.gif" alt="" class="right" /> 
           </div> 
           <div class="content"> 
            <%=Html.CelloValidationMessage("EmployeeProfileMessage", new { @class = "exception" })%> 
           </div> 
           <div class="footer"> 
            <img src="../../App_Themes/PropelSkin/fail-btm1.gif" alt="" class="left" /> 
            <img src="../../App_Themes/PropelSkin/fail-btm2.gif" alt="" class="right" /> 
           </div> 
          </div> 
         </div> 
        </div> 
       </div> 
       <%} %> 
      </div> 
     </div> 
    </div> 
</div> 

相關問題