Is the concept of Resuable Component killed in ASP.NET MVC?
Following my previous question Confused about ASP.NET MVC and Server Control
It seems ASP.NET MVC is just going back to flat world of ASP or JSP in the old days in the Visual Layer. Does it mean they killed the concept of components that is so crucial for composability and reusability ?
How do I create a resuable visual complex component then开发者_Python百科 ? Components that can be assembled like some legos.
I think you'd have to look at jQuery plugins and HTML Helpers - no reason why they can't be easily packaged - in fact some are already being deployed via the nuget package manager - for exmaple see PagedList.Mvc
See this post for an example of how to build your own "control" in the form of an Html helper
In addition 3rd party vendors have already started to supply commercial offerings - for example Teleriks mvc suite
You could:
- Write an HTMLHelper
- Write directly to the outgoing view stream.
- Create partial controls.
- Create a nuget package
- Use embedded resource views/controllers via Portable Area methodology.
So no, I don't think anything is "killed" and we certainly aren't going backwards.
精彩评论