Sunday, 18 February 2018

Mvc is an architectural pattern that divides an application into three interconnected parts where as asp.net MVC is web application framework developed by Microsoft on the top of asp.net framework(Asp.net is part of .Net framework) for creating web applications which implements MVC(Model -View-Controller) pattern.
ASP.NET Web Form was a replacement for Microsoft’s Active Server Pages (ASP) but ASP.NET MVC is not a replacement for ASP.NET Web Forms and it’s just an alternate way of making an ASP.NET website.

ASP.NET MVC is open source!- In March 2012, Scott Guthrie announced ASP.NET MVC, Razor and Web API under an open source license (Apache License 2.0).

Request flow in Asp.net MVc :
1) When end user hits a URL on browser,the request is sent to the server through browser and this first request is received by controller (User interaction logic is handle by controller)
2) Controller request to the model for information and Model in turn calls the data access layer which fetches data in the model.
3) Finally controller updates view according to model and end user gets response as view .
Why Asp.net MVC

1) Follows Separation of Concerns Philosophy
   i)Components are only responsible for one thing
   ii)Loosely coupled
   iii)Modular components
2) Clean URL
3) Full Control Over the User Interface or the HTML
4) Better For Search Engine Optimization
5) Loosely Coupled so Each Component can be tested independently. Better Support For Test Driven Development.

Problems in Asp.net Webform
1) View Based architecture for an Action Based requirement.
HTTP protocol is action oriented that means when end user sends requests(i.e. actions) and get response .In asp.net web form when we want to perform an action by clicking on button,the request is sent to view(page having .aspx  extension)  which kicked off behind code having complicated page life cycle and finally executes the logic written in button click event.But in asp..net mvc end user request is directly sent to action within controller and depending up the logic it calls view.

2) Behind code is not reusable
Code behind page(page having .aspx.cs extention) in asp.net webform  is not reusable  but in asp.net MVC code behind logic is written in action of controller so same logic can be used for different view. 
 


3) Bandwidth consumption
Viewstate of asp.net webform generates extra bytes  which consumes more bandwidth even  it automatically saves states between post backs and reduces our development time.

4) Slow Response time
Browser can understand only HTML so every server controls of asp.net webform should be converted into HTML and there is some conversion logic in server due to which response time of asp.net webform is slower than asp.net MVC.


5) Default return response is always HTML
In asp.net webform default response time is HTMLso if we want to get string response we should create HTTP handler.But in Asp.net MVC it is very easy just return string.
References :
1) https://www.questpond.com/
2) https://www.codeproject.com/Articles/866143/Learn-MVC-step-by-step-in-days-Day

3 comments:

  1. This blog gives very important info about .Net Thanks for sharing
    .Net Online Training

    ReplyDelete
  2. Thanks a lot for sharing such a good source with all, i appreciate your efforts taken for the same. I found this worth sharing and must share this with all.

    Thanks a lot for sharing such a good source with all, i appreciate your efforts taken for the same. I found this worth sharing and must share this with all.

    ReplyDelete

Powered by Blogger.

Followers

Translate

Currency Converter

Exchange Rate

Featured post

Interpolation in angular 5

When we want to communicate from component class to template ,we can use interpolation which use the { { expression }} to render the bound...

Popular Posts

My Facebook Page