locked
Master page with menu links should not refresh whole page RRS feed

  • Question

  • User-1513812710 posted

    I am trying to stop loading of masterpage everytime whenever user navigating from one page to another page. There is no complete solution available. I am trying to use iframe but its not working. On every click page is loading. Can someone please guide me with the best solution for this with code. At some places it's mentioned that this will best done by UpdatePanel. I am stuck now. Please guide me. Below is code of my master page.

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Partner.master.cs" Inherits="Benchkart.Partner.Partner" %>

    <!DOCTYPE html>

    <html>
    <head runat="server">

    <meta content='width=device-width, initial-scale=1.0, user-scalable=0' name='viewport'>
    <base>
    <meta name="description" content="IT Shared Services" />
    <title>IT Talent Sharing - BenchKart</title>
    <link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
    <link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/base/jquery-ui.css"
    rel="stylesheet" type="text/css" />
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

    <%-- <link rel="stylesheet" href="css/Custom.css" />--%>
    <link href="../css/benchkart.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/Custom.js"></script>

    <link href="../css/style.css" rel="stylesheet" />
    <link href="../css/style4.css" rel="stylesheet" />
    <%--<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery-footable/0.1.0/css/footable.min.css"
    rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-footable/0.1.0/js/footable.min.js"></script>
    <script type="text/javascript">
    $(function () {
    $('#tblProjects').footable();
    });
    </script>--%>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <div class="wrapper d-flex align-items-stretch">
    <nav id="sidebar">
    <div class="sidebar-header">
    <h3 style="color: white;">
    <asp:Image ID="imgCompanyLogoBig" ImageUrl="~/Images/imgSelect.png" runat="server" Height="80px" Width="80px" Style="border-radius: 50%; margin-left: 40px;"></asp:Image>
    <br />
    Times Infotect</h3>
    <strong>
    <asp:Image ID="imgCompanyLogoSmall" ImageUrl="~/Images/imgSelect.png" runat="server" Height="50px" Width="50px" Style="border-radius: 50%;"></asp:Image></strong>

    </div>
    <ul class="list-unstyled components mb-5">
    <li id="liProjects">
    <a href="Projects.aspx"><i class="fa fa-rocket"></i><span>Projects</span></a>
    </li>
    <li id="liBids">
    <a href="Bids.aspx"><i class="fa fa-paper-plane"></i><span>Bids</span></a>
    </li>
    <li id="liContracts">
    <a href="Contracts.aspx"><i class="fa fa-pencil-square-o"></i><span>Contracts</span></a>
    </li>
    <li id="liMessages">
    <a href="#msgSubmenu" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">
    <i class="fa fa-envelope"></i><span>Messages</span>
    </a>
    <ul class="collapse list-unstyled" id="msgSubmenu">
    <li>
    <a id="liInbox" runat="server" href="Messages.aspx?action=inbox"><span>Inbox</span></a>
    </li>
    <li>
    <a id="liSent" runat="server" href="Messages.aspx?action=sent"><span>Sent</span></a>
    </li>
    </ul>
    </li>
    <li id="liServices">
    <a href="Services.aspx"><i class="fa fa-cogs"></i><span>Services</span></a>
    </li>
    <li id="liSkills">
    <a href="Skills.aspx"><i class="fa fa-search-plus"></i><span>Talent Skills</span></a>
    </li>
    <li id="liProfile">
    <a href="PartnerProfile.aspx"><i class="fa fa-home"></i><span>Profile</span></a>
    </li>
    </ul>

    <div class="footer">
    <p>
    Copyright &copy;<script>document.write(new Date().getFullYear());</script>
    All rights reserved
    </p>
    </div>
    </nav>

    <!-- Page Content -->
    <div id="content" style="padding: 0px;">
    <div style="background-color: White; color: Black; display: flow-root; height: 60px;">
    <div style="float: left; margin-top: 20px;">
    <button type="button" id="sidebarCollapse" class="btn btn-primary" style="background-color: #F79507; border-color: #F79507;">
    <i class="fa fa-bars"></i>
    <span class="sr-only">Toggle Menu</span>
    </button>
    </div>
    <div style="float: left; margin-left: 10px; margin-top: 8px; font-size: 25px; color: #F79507;">
    kart
    </div>
    <div style="float: right; margin: 15px; font-size: 15px;">
    <asp:Label runat="server" ID="lblEmail" ForeColor="Black" Style="float: left;"></asp:Label>
    <asp:LinkButton runat="server" ID="lnkSignout" ForeColor="Gray" Text="Sign out" Font-Underline="false"
    Style="margin-left: 15px; text-decoration: underline;" OnClick="lnkSignOut_Click"></asp:LinkButton>
    </div>
    </div>
    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
    </asp:ContentPlaceHolder>
    </div>
    </div>
    <script src="../Scripts/popper.js"></script>
    <script src="../Scripts/main.js"></script>
    </div>
    </form>
    </body>
    </html>

    Tuesday, January 28, 2020 1:36 AM

Answers

  • User-1716253493 posted

    Seem like you have wrong understand with master page.

    You think that master page is like menu iframe and content page is like main iframe. It's not like that.

    Say master page have X and content page

    Page A containing "A", Page B containing B

    Rendered Page A will XA

    Rendered Page B will XB

    When you area in Page A then go to Page B, the browser will load deferent page (whole page)

    You need one page say X.aspx that containing content frame

    Give links in that page with target property to content frame.

    When you click link to A.asxp, you are still in x.aspx but the frame load A.aspx

    In this case, there is no relation with master page.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 28, 2020 7:07 AM

All replies

  • User-1716253493 posted

    You are navigate to another page, so why whole page always refresh.

    Update panel will not work because you are navigate to deferent page.

    If you dont want refresh whole page, stay on one page then reload the part of the page using iframe or updatepanel etc.

    Tuesday, January 28, 2020 3:54 AM
  • User-1513812710 posted

    Thanks. That can help. But where I shall put the links which are there in master page? Because each time the link is clicked it will reload the page.

    Tuesday, January 28, 2020 4:34 AM
  • User-1716253493 posted

    Seem like you have wrong understand with master page.

    You think that master page is like menu iframe and content page is like main iframe. It's not like that.

    Say master page have X and content page

    Page A containing "A", Page B containing B

    Rendered Page A will XA

    Rendered Page B will XB

    When you area in Page A then go to Page B, the browser will load deferent page (whole page)

    You need one page say X.aspx that containing content frame

    Give links in that page with target property to content frame.

    When you click link to A.asxp, you are still in x.aspx but the frame load A.aspx

    In this case, there is no relation with master page.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 28, 2020 7:07 AM
  • User-1513812710 posted

    Thanks, I removed master page and used a single page to display another page with in it with the help of iframe. That's working now.

    Tuesday, January 28, 2020 12:24 PM