2010-12-08 1 views
0

Je travaille dans l'exemple d'application mvc 2. en ce que je suis manipulé le délai d'expiration de session dans le web.config le code suivant est ceci.Renvois de délai d'expiration de session dans le panneau en mvc 2

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

ce code est fonctionne très bien pour les écrans quand je gardais les écrans du ralenti ....

mais mon problème est dans un écran particulier i ayant huit onglets dans un panneau si la session la page de connexion est redirigée, après la phase inactive, si je clique sur le bouton lien dans l'onglet, elle est redirigée page de connexion dans le panneau à onglets pas redirigé vers la page de connexion.Tous les onglets sont fait avec usercontrols Voir pour référence ....

Répondre

0

Vous devez avoir la page de connexion de tous les cadres, donc dans le head de la page de connexion ajouter le suivant Java Scénario:

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

i ont utilisé ce script dans la page de connexion, il ne travaille pas –

+0

Essayez mon code mis à jour – cspolton

+0

pas son ne fonctionne pas voir ma page de connexion page –

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> 

Questions connexes