EXT: ASP. NET MVC 3 and App_Code folder

Source: Internet
Author: User

Problem:

In ASP. Webform, App_Code is Standardfolder to putting Code and using it at Run-time. But I think this folder was kind of different in ASP. NET MVC, my question is:

    • Where should I put my code (Extension methods, Helpers, ...) in ASP. When the I store code in App_Code folder, I can ' t use the theme in controller but they work fine in the views.

    • About the Entity Framework, the same question, where should I put edmx and tt files. I ' m not using Code-first

Update:

After some search, finally I created a new Class Library project in my solution, code was available in Allcontroll ERs and views. I still don ' t know why the code in App_Code was not a available in controller

Reply:

App_Code is necessary in Web Site projects because it has a special meaning. It means "Don t serve these files to a Web browser". In ASP. Directly served to the browser in most cases, so App_Code was not necessary. You can place the code files whereever you want, with any folder for you want.

Using A stand-alone library is also a fine solution.

EXT: ASP. NET MVC 3 and App_Code folder

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.