2010-12-08 25 views
0

サンプルmvc 2アプリケーションで作業しています。私はweb.configのセッションタイムアウトを処理しているので、次のコードはこれです。私はアイドルで画面を保持するときセッションタイムアウトはmvcのパネル内のリダイレクト2

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

これはコードでは

....スクリーンのため正常に動作しているが、私の問題は、セッション場合、私は1枚のパネルに8つのタブを持つ一つの特定の画面でありますログインページがリダイレクトされます。アイドル状態の後、タブ内のリンクボタンをクリックすると、タブページ内のログインページがリダイレクトされ、ログインページにリダイレクトされません。すべてのタブは、usercontrolsで参照されています....

答えて

0

ログインページの中から任意のフレームセットを削除する必要があります。そのため、ログインページのheadに次のJavaを追加してくださいスクリプト:

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

私はそれが私の更新されたコード –

+0

動作していないのログインページにこのスクリプトを使用していますページ – cspolton

+0

何その私のログインページを参照してください作業していないされていないしてみてください –

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> 

関連する問題