Thoughts on using the MVC Framework

Source: Internet
Author: User

The project uses a third-party MVC Framework, which is similar to Microsoft's built-in MVC framework.

I have been developing WebForm before. After using the MVC framework, I feel something is more convenient. It seems that the direct use of html controls is more flexible than the previous use of ASP. NET Server controls, and the JS control front-end is also convenient.

The background code is messy. Some controllers write nearly one thousand lines of code, which is even more exaggerated by colleagues.

The framework we use. A Controller corresponds to an html Directory, which is defined by the framework. Therefore, the background code of html under a directory is written in a Controller for a long time. I generally use # region to organize code. If there is no # region like java, it will crash even more.

WebForm is a page that corresponds to a background code, which is more convenient. Now, a Controller needs to write code for several pages. I can only use # region to organize the code. # region contains many # region, and then write the functions of this page, for example, add, delete, modify, and query. However, I feel that the MVC background code is more flexible than WebForm, but there is one thing, page Jump, Page Link, page transfer value, and so on, and the writing is a bit dizzy, it Seems messy, but searching for code is much more convenient than java.

The following code is a neat one, corresponding to two Report pages plus a menu page, more than 800 lines.

The following code corresponds to more html pages.

I feel that my code may not be well written, but I don't know where it is. So I hope to read this article and give more comments. Thank you!

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.