ASP. NET MVC

Source: Internet
Author: User
ASP. ASP. after years of development, the net developer finally looks forward to it. Here, I don't want to comment too much on the advantages of MVC. If I don't know about it, I can search for a lot of information.
I have heard many people say this: "Microsoft's web development architecture has finally matured! ", The implication of this sentence is that Microsoft's web development architecture has never been mature!
I am sorry for those developers who support webform PostBack and viewstate/controlState, because I do agree with this statement!

I really hate the so-called PostBack and viewstate/controlState. They always make the final HTML messy; the element ID is unpredictable by JavaScript writers (although this can still be solved, but the solution is not correct.) CSS cannot control the elements of an ID! The element ID passed to JavaScript or CSS through <% = %> is not beautiful and has many restrictions (for example, we want to get an ID in an external JS file ), this also makes debugging inconvenient.

In addition, the annoying viewstate/controlState is sometimes too many, which increases network bandwidth and makes HTML messy. Although it does solve the problem that the server cache is too resource-consuming, viewstate can also be disabled. However, many developers still hate "client/server-side dynamic creation of elements, controls, and viewstate" and other issues! I feel that it is better to write a lightweight solution that maintains state than viewstate.

HTML of web pages developed using ASP. NET is unreadable, spaces and indentation are unpredictable, and element IDs are hard to predict. These are annoying!

In. Net 3.5, the listview makes HTML control more free. I especially like this control.

In ASP. net mvc, the previous PostBack mechanism was naturally unavailable (of course we can write a custom State maintenance mechanism), as Scott Gu said:
It does not, however, use the existing post-back model for interactions back to the server. instead, you'll route all end-user interactions to a controller class instead-which helps ensure clean separation of concerns and testability (it also means no viewstate or page lifecycle with MVC Based views ).

Obviously, Microsoft has recognized the latencies of ASP. NET in the past. Microsoft has abandoned PostBack for IOC/MVC, pluggable, and testability! The advanced idea of software development is the development direction of productivity. If we don't keep up with it, we will eventually be eliminated.

From Scott Gu's example, it can be seen that Microsoft also obviously recommends using the same syntax as traditional ASP to precisely control HTML or use listview to get JavaScript and CSS-friendly HTML. to obtain JavaScript and CSS-friendly HTML, you must precisely control the syntax of HTML.CodeBackend and control HTML encapsulation, but these should all be done in hierarchical design and should not be emphasized in form. jsp has always done better.

Microsoft is a smart company. Haven't it been catching up after a few years behind?

with MVC, a more open MVC Architecture, Microsoft's web development platform is bound to become more closely integrated with open-source Orm, unittest frameworks and tools, similar to Java's web development platform, the platform presents a prosperous and open source. net ide -- the appearance of sharpdevelper also indicates this. in the future, Microsoft's development platform will be more open and will be integrated with open-source products as never before. this is undoubtedly a good trend. Let's wait and see!

Related Article

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.