错误:-
执行处理程序“System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper”的子请求时出错。
我的主页视图是这个
{
ViewBag.Title = "Start";
}
<h2>Start</h2>
<script type="text/javascript">
$(document).ready(function () {
$("#test1").click(function (e) {
$("#firstpartialview").css("display", "none");
$("#secondpatialview").css("display", "none");
$("#firstpartialview").css("display", "block");
});
$("#test2").click(function (e) {
$("#firstpartialview").css("display", "none");
$("#secondpatialview").css("display", "none");
$("#secondpatialview").css("display", "block");
});
});
</script>
<a id="test1"></a>
<a id="test2"></a>
<div id="firstpartialview">@Html.Action("FirstView", "Home") </div>
<div id="secondpatialview">@Html.Action("SecondView", "Home") </div>
我的控制器是这样的:-
public ActionResult Start()
{
return View();
}
public ActionResult FirstView()
{
ModelA objA = new ModelA();
return PartialView(objA);
}
public ActionResult SecondView()
{
ModelB objB = new ModelB();
return PartialView(objB);
}
我的部分观点是这个
_partialA.cshtml
@model demo3.Models.ModelA
@{
ViewBag.Title = "_partialA";
}
<h2>_partialA</h2>
<div>@Html.EditorFor(m => m.EmployeeId) </div>
<div>@Html.EditorFor(m => m.EmployeeName)
另一个部分观点是
_partialB.cs.html
@model demo3.Models.ModelB
@{
ViewBag.Title = "_partialB";
}
<h2>_partialB</h2>
<div>@Html.EditorFor(m => m.Comapny) </div>
<div>@Html.EditorFor(m => m.FisacalYear) </div>
请帮我解决错误..在浏览器上这个错误来了
未找到局部视图“FirstView”或没有视图引擎支持搜索的位置。搜索了以下位置:
~/Views/Home/FirstView.aspx
~/Views/Home/FirstView.ascx
~/Views/Shared/FirstView.aspx
~/Views/Shared/FirstView.ascx
~/Views/Home/FirstView。 cshtml
~/Views/Home/FirstView.vbhtml
~/Views/Shared/FirstView.cshtml
~/Views/Shared/FirstView.vbhtml