Studies with MVC4 six: website background management

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

The backstage management part intends to use a separate area. Mainly for the establishment and management of the website, preliminary ideas to achieve the following functions:

image

First, the establishment of regional Admin.

In the project right click on the -> -> addition; regional. Enter the name "Admin".

image

Create a new directory

image

As can be seen from the chart, their model area. Controllers, views and routing, as a sub project.

Double click to open ControlAreaRegistration.cs

Change the code as follows:

using System.Web.Mvc;

namespace Ninesky.Areas.Admin

{

    public class ControlAreaRegistration : AreaRegistration

    {

        public override string AreaName

        {

            get

            {

                return "Admin";

            }

        }

        public override void RegisterArea(AreaRegistrationContext context)

        {

            context.MapRoute(

                "Admin_default",

                "Admin/{controller}/{action}/{id}",

                new { action = "Index", id = UrlParameter.Optional }

            );

        }

    }

}

Today write here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Jack at November 17, 2013 - 12:08 PM