MVC Extensibility

Last post 12-28-2007 9:03 AM by nagir. 3 replies.

Sort Posts:

  • MVC Extensibility

    12-23-2007, 7:19 AM
    • Loading...
    • tajari
    • Joined on 12-23-2007, 12:07 PM
    • Posts 1

    I've loved the work you've done but It needs some extensibility on the view it renders. I see it supports only asp.net built in page extensions like .aspx or .ascx for processing views. If it supports registered handlers within the application or it uses view classes instead of .aspx files, it would be more extensible.

    Now, the following code:

    RenderView("About");

    executes "About.aspx" some where and if I register an '.abc' extension within my custom handler, it does not recognize it.

    Mohammad

  • Re: MVC Extensibility

    12-23-2007, 11:09 AM

    You can use the controller's ViewFactory property to provide your own View Engine implementation. If you are using an IControllerFactory you can set that automatically in all your controllers. Using an IoC container to instantiate your controllers will make this even smoother.

     

    __________________________________________
    Sergio Pereira
    http://devlicio.us/blogs/sergio_pereira/
  • Re: MVC Extensibility

    12-23-2007, 3:17 PM
    • Loading...
    • abombss
    • Joined on 06-27-2006, 4:13 PM
    • Chicago, IL
    • Posts 164

    tajari:
    If it supports registered handlers within the application or it uses view classes instead of .aspx files, it would be more extensible.
     

    You don't need handlers with mvc.  Your controller has total control over what view gets rendered, and routes allow you to map anything to a particular controller.

    If a request comes in /blog/Mvc-Needs-No-Handlers you can render regular html when it comes in /blog/Mvc-Needs-No-Handlers.xml you can output xml.  You can also checkout this post for outputting an image.

    I think this is what you are asking?

     

    Adam Tybor -- abombss.com
    Filed under: ,
  • Re: MVC Extensibility

    12-28-2007, 9:03 AM
    • Loading...
    • nagir
    • Joined on 01-10-2006, 12:01 AM
    • Australia
    • Posts 107

    Hi Tajari, 

    tajari:
    if I register an '.abc' extension within my custom handler, it does not recognize it

    I believe you should also register ISAPI filter in the IIS to support other extensions.

    Have a look here.

    Regards,
    Dmitriy.

Page 1 of 1 (4 items)
Microsoft Communities
Page view counter