Asp.net MVC - Can I reference views from a class library?

In an asp.net MVC application, can I refer to views from the class library in the same way that I can refer to the class library of server controls or user controls in asp.net Web Forms?

I saw this blog post: http://padcom13.blogspot.com/2009/04/splitting-aspnet-mvc-application-into.html , although the described method involves copying the views that will be reused in the application.

Any thanks, thanks.

+4
source share
1 answer

I suppose this would be theoretically possible if you use a custom view engine that loads templates from the class library.

This approach, however, seems rather wrong. If you want to create an analogue of server controls, it is best to implement them as Html helpers, since the MVC command has already begun. Shameless plugin - you can look at the html helpers for jQuery UI that were built by Telerik - they use a wrapped approach.

+2
source

All Articles