The real right way to add zones in MVC!

Source: Internet
Author: User

This article is the result of finding out the reason for 1 days ' time. Morning encounter pit, search on the Internet countless information, hehe, whether it is a master, or rookie article, are not to say clearly, in the key place left a big pit, also need my problem too elementary, others have skipped, hehe. Go to the top (master please float over):

Add Zone admin in MVC, debug times wrong:

And all of my routing information is based on the online textbook to configure, in short is the configuration of AdminAreaRegistration.cs files and RouteConfig.cs, unclear Baidu.

It took me nearly a day to check the information, to the group to consult, hehe, no answer. Later, I was suddenly inspired, thought: In the AdminAreaRegistration.cs registry namespace should be used in the areas controller actual namespace, and should not be on-line textbook: Project namespace. Areas.Admin.Cotrollers form, the result of a test, success!

specifically to my project, start registering the namespace is subject to online misleading, using: New string[] {"FWMemberOffice.Areas.Admin.Controllers"}, the result is the error mentioned earlier, and later with the new string[] {" Fwadmin.controllers "} was successful.

PostScript: Write the article is not rigorous misleading people, is really wasting other people's time, online flooding a lot of such things! Everyone in the specific project, often the separate development of the project, completed with areas merged together, this is a more common process, this time, areas in the controller namespace is definitely not " FWMemberOffice.Areas.Admin.Controllers "form.

The real right way to add zones in MVC!

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.