1. Site users
The site is divided into three types of users: not logged in user, login user, administrator ([email protected])
Administrator Navigation Bar:
Login User navigation Bar:
User navigation bar not logged in (can only browse information):
2. Layout page Design
Planning: Designing two Layout pages: mylayout.cshtml, _layoutuser.cshtml
(1) Application mylayout.cshtml is the page: Front home, article List page, article content page
(2) Application _layoutuser.cshtml pages are: My article page, my profile page, post page, article management page, user Management page, etc.
3. Modify the contents of the mylayout.cshtml navigation bar
4. New Detail View _addadminlink.cshtml
Add the administrator-owned link code:
<li class= "Active" ><a href= "/article/articlelist" > Article Management </a></li>
<li class= "Active" ><a href= "/account/index" > User Management </a></li>
5. New method in AccountController Getaddadminlink
Public ActionResult Getaddadminlink ()
{
if (user.identity.name== "[email protected]")//If it is an administrator account
{
Return Partialview ("_addadminlink");//Import Detail View
}
Else
{
return new Emptyresult ();
}
}
6. New Layout page--_layoutuser.cshtml
Copy the entire contents of the mylayout.cshtml. Then modify the navigation bar section.
7. Adjust the layout page for an existing page
such as Views-account-index. Cshtml you need to adjust the layout page
Layout = "~/views/shared/_layoutuser.cshtml";
8. Modify the detail method under AccountController
After adjusting, you can view your information through the session.
9. Adjust the jump hyperlink on successful login and the hyperlink on the user's mailbox on the navigation bar.
(1) views-shared-_loginpartial.cshtml
(2) Controllers-accountcontroller-login
10. Create a series of required actions under the article controller and add the corresponding view
So far, the basic structure of the project has been ~~
It has been successful more than half!!!
Also lacks the homepage, the foreground article list, the article display, backstage my article list, the article management and so on.
MVC Series-12. Project Re-planning