Layui Click on the left navigation bar to realize the entire page, only refresh the local method

In fact, this article will give yourself, I will forget how to do it back, I can see

Click on the left menu bar to refresh the part, locally use iframe.

First build the Layout page, build the left menu bar, then below @renderbody ()

  
  • Review
  • @renderbody () @renders, Required: false
and then write JS for clicking jump The top of the @renderstection ("Scripts", Required: false and below #demoadmin are in another page, that is, the iFrame page

// javascript code area Layui.use (‘element’, function () {var $ = layui.jquery, element = layui.ement;}); $ (“. Card”). Click (function () {$ (” #demoadmin “). Attr (” src “,” / admin / cardmanage”)}); $ (“. project “). click (” # demoadmin “). Attr (” src “,” / admin / project management “); $ (“. funds ” ) .click (“# demoadmin”). Attr (“src”, “/ admin / fundsmanagement”)});
     New HomeController, New INDEX page 

@ {layout = null; layout = “~ / allaster / admin / views / shared / _Layout.cshtml”;}
[ @Section scripts { reheight (); $ (window) .resize ();}; // set iframe height function reheight () {var bodyHeight = $ (window) .height (); bodyHeight – 107; IF (BodyHeight
    Take the top of Layout.  <400) {
    bodyHeight = 400;
  }
  $("#demoAdmin").height(bodyHeight);
  }
   Other pages reference = "~ / Areas / Admin / Views / Shared / _LayOutpage.cshtml ";  
I put CSS and JS references in another layout, so I need to quote it.Otherwise, the page will be chaotic.
The above Layui clicks on the left navigation bar. It does not refresh the entire page. It is only to refresh the local method is the total content of Xiaobian sharing. I hope I can give you a reference, I hope everyone will support it. Tumi cloud.

© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment