开发者

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:

  1. Write an HTMLHelper
  2. Write directly to the outgoing view stream.
  3. Create partial controls.
  4. Create a nuget package
  5. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜