Asp.net mvc 引导导航条在每次导航点击时重新加载
我有一个twitter引导导航栏,但每次我在链接上导航时,它显然是在重新加载导航栏和其他所有内容。它不应该这样做吗?如果不是的话,我会喜欢的。我不确定我的布局是否有问题。你知道为什么我的导航栏会被重新加载吗Asp.net mvc 引导导航条在每次导航点击时重新加载,asp.net-mvc,twitter-bootstrap,nav,Asp.net Mvc,Twitter Bootstrap,Nav,我有一个twitter引导导航栏,但每次我在链接上导航时,它显然是在重新加载导航栏和其他所有内容。它不应该这样做吗?如果不是的话,我会喜欢的。我不确定我的布局是否有问题。你知道为什么我的导航栏会被重新加载吗 <link href="../../bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" /> <link href="../../bootstrap/css/bootst
<link href="../../bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="../../bootstrap/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/dt-min.js")" type="text/javascript"></script>
<link href="../../Content/Reflection.css" rel="stylesheet" type="text/css" />
@Styles.Render("~/Content/themes/base/css", "~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<header>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<div class="float-left" style="width:315px">
<p class="site-title">@Html.ActionLink("Kinfolk", "Index", "Home", new { @style = "color:Orange" })</p>
</div>
<div class="float-center">
<section id="login">
@Html.Partial("_LoginPartial")
</section>
<nav>
<ul id="menu" class="nav">
<li>
<div class="reflection">
<a href="@Url.Action("AllWallPost", "Home")" title="Home">
<img src="../../Images/home (1).ico" />
</a>
</div>
</li>
<li>
<div class="reflection">
<a href="@Url.Action("UserProfile", "UserProfile")" title="My Profile">
<img src="../../Images/user.ico" />
</a>
</div>
</li>
<li>
<div class="reflection">
<a href="#" title="Events">
<img src="../../Images/calendar_2.ico" />
</a>
</div>
</li>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</header>
<div id="body">
@RenderSection("featured", required: false)
<section class="content-wrapper main-content clear-fix">
@RenderBody()
</section>
</div>
<footer>
<div class="content-wrapper">
<div class="float-left">
<p>© @DateTime.Now.Year - My ASP.NET MVC Application</p>
</div>
<div class="float-right">
<ul id="social">
<li><a href="http://facebook.com" class="facebook">Facebook</a></li>
<li><a href="http://twitter.com" class="twitter">Twitter</a></li>
</ul>
</div>
</div>
</footer>
@Scripts.Render("~/bundles/jquery")
@RenderSection("scripts", required: false)
</body>
@style.Render(“~/Content/themes/base/css”,“~/Content/css”)
@Scripts.Render(“~/bundles/modernizer”)
@Html.ActionLink(“Kinfolk”、“Index”、“Home”、新的{@style=“color:Orange”})
@Html.Partial(“_LoginPartial”)
@渲染部分(“特色”,必填项:false)
@RenderBody()
&抄袭@DateTime.Now.Year-我的ASP.NET MVC应用程序
@Scripts.Render(“~/bundles/jquery”)
@RenderSection(“脚本”,必需:false)
根据您提供的代码,单击链接时重新加载页面是正常的 如果您希望在不重新加载所有内容的情况下更改页面,则必须使用一些Ajax(JavaScript)以及
Request.IsAjaxRequest()
(控制器)和PartialView
(视图)的组合
有很多关于这些关键字的资源。根据您提供的代码,当您单击链接时,页面重新加载是正常的 如果您希望在不重新加载所有内容的情况下更改页面,则必须使用一些Ajax(JavaScript)以及
Request.IsAjaxRequest()
(控制器)和PartialView
(视图)的组合
有很多关于这些关键字的资源。关于性能或其他方面。我应该配置代码以阻止导航栏重新加载,这很重要吗?还是所有内容都重新加载?谢谢回复。事实上,我刚刚意识到,导航栏正在为chrome重新加载,而不是IE,go figure。不知道为什么。@TMan不,你只是看到了chrome页面加载的闪光,但它同时为这两个页面重新加载。我想说,现在还可以,不要担心性能。至于性能或其他方面。我应该配置代码以阻止导航栏重新加载,这很重要吗?还是所有内容都重新加载?谢谢回复。事实上,我刚刚意识到,导航栏正在为chrome重新加载,而不是IE,go figure。不知道为什么。@TMan不,你只是看到了chrome页面加载的闪光,但它同时为这两个页面重新加载。我想说现在还可以,不要担心性能。