The ASP.NET MVC framework is a new and lightweight architectural pattern still in its infancy. Although evolving from Preview 1 to Preview 4, there are still a great many supplements and enhancements necessary. So far, there have not been any real scenarios of ASP.NET applications putting it into practice. Now, I'm going to use scraps of code to list the disadvantages (immaturity) of ASP.NET MVC as far as I know. This is the fourth part of a four-part series that compares ASP.NET Web Forms with ASP.NET MVC.
(1) Writing View Contents the Old ASP-Like Way
As you may have noticed above, it uses an inline mode, foreach, to render the .aspx page’s contents. Indeed, code generated in the above mode is spotless whether in the case of cleanness or from the angle of self definition. But……yes, as you have seen, it’s the original ASP mode, just switched to another term—the ASP.NET MVC-styled template! Isn't it ironic? Yet, this is indeed the fact.
Since a flock of developers are now ready to embrace ASP.NET MVC without hesitation, are they also ready to deal with the old-style inline mode? Due to the features of ASP.NET MVC (mainly a ViewData transferred from the Controller to the View), the true ASP.NET MVC template syntax requires a plus CAST, such as the following (of course, you can also use the strong-typed ViewData supported by ASP.NET MVC, which can help to avoid such a cast operation).
Read More..
No comments:
Post a Comment