我的屏幕如下所示:
如您所见,客户信息和余额显示在我的 _Layout.cshtml 之外。
这是我的 _Layout.cshtml:
<!DOCTYPE html>
<html>
<head>
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script>
$(function () {
$('.focus :input').focus();
});
</script>
</head>
<body>
<div class="page">
<div id="header">
<div id="logindisplay">
@Html.Partial("_LogOnPartial")
</div>
<div id="menucontainer">
<ul id="menu">
@if (User.Identity.IsAuthenticated)
{
<li>@Html.ActionLink("Update Account", "UpdateAccount" , "Account")</li>
<li>@Html.ActionLink("Change Password", "ChangePassword", "Account")</li>
<li>@Html.ActionLink("Accounts", "CustomerSummary", "Customer")</li>
}
else
{
<li>@Html.ActionLink("Logon", "Logon", "Account")</li>
<li>@Html.ActionLink("Register", "Register", "Account")</li>
}
<li>@Html.ActionLink("ContactUs", "ContactUs", "Home")</li>
</ul>
</div>
</div>
<div id="main">
@RenderBody()
</div>
<div id="footer">
</div>
</div>
</body>
</html>
还有我的网页:
@model SuburbanCustPortal.SuburbanService.CustomerData
@{
ViewBag.Title = "Account Screen";
}
<h2>AccountScreen</h2>
<div class="leftdiv">
<fieldset>
<legend>customer info</legend>
@Html.Partial("CustomerInfoPartialView", Model)
</fieldset>
</div>
<div class="rightdiv">
<fieldset>
<legend>balance</legend>
<div>
@Html.Partial("BalancePartialView", Model)
</div>
</fieldset>
</div>
任何想法为什么它不在我的布局内?