MVC Series-12. Project Re-planning

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.