I am trying to implement MVC pattern with ASP.NET in the following way without using the MVC framework.
- page1.aspx page (html - View)
- page1.cb (code behind - Controller)
- Module1UIHelper.cs (Service class for a module - Model
please let me know if this approach is ok and other ways to implement MVC pattern with ASP.NET.
Thanks,
Raghav
Hi,
The best approach to go for MVC pattern without System.Web.MVc is to utilize Microsoft ASP.NET generic Handlers .ashx file. You can have web form .aspx page as view and handlers can communicate with .aspx page to GET or POST the data using jquery.ajax method. It can return result same as in MVC as JSON. the biggest benefit of handler is that it avoids to declare every method as static as in-case of using the code behind file of aspx page directly to utilize MVC pattern in web form application.
Please feel free to contact me if need more clarification or any sample code for the same
Thanks and Regards
Murtuza Patel