修改一些BUG
This commit is contained in:
11
MvcApplication1/Views/Shared/Error.aspx
Normal file
11
MvcApplication1/Views/Shared/Error.aspx
Normal file
@@ -0,0 +1,11 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<System.Web.Mvc.HandleErrorInfo>" %>
|
||||
|
||||
<asp:Content ID="errorTitle" ContentPlaceHolderID="TitleContent" runat="server">
|
||||
错误
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="errorContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<h2>
|
||||
抱歉,处理您的请求时出错。
|
||||
</h2>
|
||||
</asp:Content>
|
||||
14
MvcApplication1/Views/Shared/LogOnUserControl.ascx
Normal file
14
MvcApplication1/Views/Shared/LogOnUserControl.ascx
Normal file
@@ -0,0 +1,14 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
|
||||
<%
|
||||
if (Request.IsAuthenticated) {
|
||||
%>
|
||||
欢迎您,<b><%: Page.User.Identity.Name %></b>!
|
||||
[ <%: Html.ActionLink("注销", "LogOff", "Account") %> ]
|
||||
<%
|
||||
}
|
||||
else {
|
||||
%>
|
||||
[ <%: Html.ActionLink("登录", "LogOn", "Account") %> ]
|
||||
<%
|
||||
}
|
||||
%>
|
||||
41
MvcApplication1/Views/Shared/Site.Master
Normal file
41
MvcApplication1/Views/Shared/Site.Master
Normal file
@@ -0,0 +1,41 @@
|
||||
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
|
||||
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="page">
|
||||
|
||||
<div id="header">
|
||||
<div id="title">
|
||||
<h1>我的 MVC 应用程序</h1>
|
||||
</div>
|
||||
|
||||
<div id="logindisplay">
|
||||
<% Html.RenderPartial("LogOnUserControl"); %>
|
||||
</div>
|
||||
|
||||
<div id="menucontainer">
|
||||
|
||||
<ul id="menu">
|
||||
<li><%: Html.ActionLink("主页", "Index", "Home")%></li>
|
||||
<li><%: Html.ActionLink("关于", "About", "Home")%></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
|
||||
|
||||
<div id="footer">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user