我发现在我的应用程序中,当我重定向到一个新的控制器方法时,该控制器方法的视图不会停止加载。
部分 CSS 未完成渲染,页面无响应。
作为测试,我决定使视图尽可能简单,以查看是否加载。令我惊讶的是,它没有。因此,从下面的代码中,如果您能看到问题所在,我会感到惊讶。但是我的问题是如何找出问题所在?我正在使用 ie9 和 VS 2012,但我无法访问 ANTS。
[HttpPost]
public ActionResult FullSearch(BulkDeleteSearchViewModel bulkDeleteSearchViewModel)
{
SessionObjectsSCD.CompanyType =
CacheObjects.CompanyTypes.SingleOrDefault(x => x.TypeId == bulkDeleteSearchViewModel.TypeId);
var type = (CompanyTypeEnum)SessionObjectsSCD.CompanyType.TypeId;
var strategy = BulkDeleteSearchFactory.Get(type, bulkDeleteSearchViewModel);
var bulkDeleteSearchService = new BulkDeleteSearchService(strategy);
SessionObjectsSCD.SearchCompanies = bulkDeleteSearchService.SearchCompany();
return this.RedirectToAction(type == CompanyTypeEnum.Subcontractor ?
"FullListSubcontractor" : "FullList1");
}
[HttpGet]
[Authorize(Roles = "SCDTopLevelUser, SCDAdmin, SCDDeveloper")]
public ActionResult FullList1(int page = 1)
{
return this.View();
}
FullList1 视图看起来像;
@{
ViewBag.Title = "FullList1";
}
<h2>FullList1</h2>
布局视图看起来像;
<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]> <html class="no-js" lang="en"> <!--<![endif]-->
<html lang="en">
<head>
<meta charset="utf-8" />
<title>SCD</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
<link rel="SHORTCUT ICON" href="@Url.Content("~/favicon.ico")" />
@Styles.Render(Constants.BundleDataTablesCss)
@Styles.Render(Constants.BundleMenuCss)
@*@Styles.Render(Constants.BundleBaseCss)*@
@Styles.Render(Constants.BundleDemosCss)
@Styles.Render(Constants.BundleMobileCss)
@Styles.Render(Constants.BundlePagedListCss)
@Styles.Render(Constants.BundleBootstrapCss)
@Styles.Render(Constants.BundleSiteCss)
@Styles.Render(Constants.BundleSunnyThemeCss)
@Scripts.Render(Constants.BundleModernizr)
</head>
<body>
<div class="page">
<input type="hidden" id="Environment" value="@AppSettings.EnvironmentSetting.ToUpper()"/>
<header id="mainHeader">
<div id="title">
<div style="float:left;">@Content.Image("MulalleyLogoSmall.jpg", "float:left;padding:10px 10px 0 10px", Url)</div>
<div class="head" style="float:left;padding-top:15px;">SubContractor Database (SCD)</div>
</div>
<div id="logindisplay">
@Html.Partial("_LoginPartial")
</div>
<nav>
@Html.Partial("_MenuItems")
</nav>
</header>
<section class="main-content">
@RenderBody()
</section>
<footer>
<div class="content-wrapper">
<div class="float-left">
© @DateTime.Now.Year -Copyright Mulalley and Company Limited
</div>
<div class="float-right">
<ul id="social">
<li><a href="http://liveweb.sherrygreengrp.com/SHP/" ><b>SHP</b></a></li>
<li><a href="http://liveweb.sherrygreengrp.com/STAS/"><b>STAS</b></a></li>
</ul>
</div>
</div>
</footer>
</div>
@Scripts.Render(Constants.BundleScd)
@Scripts.Render(Constants.BundleDataTables)
@Scripts.Render(Constants.BundleSubcontractorDetail)
@RenderSection("scripts", required: false)
</body>
</html>