asp.net mvc how to separate module wise controller, model, view

First take a look on this.

http://stackoverflow.com/questions/5243158/how-to-configure-areas-in-asp-net-mvc3



In ASP.NET MVC application MVC gives use 3 part Controller, Model & View. But if we want to separate the  Controller, Model & View as our application Module based we can also implement this using AreaRegistration. Consider i want to use PIS module with seperated Controller, Model & View. i have to add a user define class, i just named it PISAreaRegistration.


  public class PISAreaRegistration : AreaRegistration  
   {  
     public override string AreaName  
     {  
       get  
       {  
         return "PIS";  
       }  
     }  
     public override void RegisterArea(AreaRegistrationContext context)  
     {  
       context.MapRoute(  
         "PIS_default",  
         "PIS/{controller}/{action}/{id}",  
         new { action = "Index", id = UrlParameter.Optional }  
       );  
     }  
   }  

if you want to add more module like PIS then you have do the all process as PIS done.

Popular posts from this blog

WPF Crystal Report Viewer Using SAP

mvc razor textboxfor change event change another textboxfor value

ASP.NET MVC razor SAP Crystal report