Why ASP.NET Web Forms?
- Success of Microsoft programming languages right from the days of VB (visual basic) it is due to RAD(Rapid application development)and visual programming approach
- By using visual studio ,developers where able to drag drop UI elements on a designer area and at the backend , visual studio generates C# or VB.NET code for those elements
Problems with Asp. Net Web Forms:
- The main problem with ASP.NET Web form is performance
- In web application there are two aspects which define performance
- Response time: - How fast the server responds to request?.
- Bandwidth consumption: - How much data is sent ?.
Response time issues:
We did a small load testing experiment of Webform vs Asp.Net MVC and we found Asp.Net MVC to be twice faster.
Why ASP.NET MVC was better in performance in the above load test:
Problem: Asp.Net webforms page life cycle.
Solution for this problem: - “GET RID of CODE BEHIND” ,fold your sleeves and work with pure HTML.
Bandwidth consumption:
- View state has been a very dear and near friend of ASP.NET developers.
- We found viewstate increases the page size twice as compared to Asp.Net MVC.
Problem: Maintaining server controls data across the post back.
Solution for this problem: - “GET RID of SERVER CONTROLS”.
Other Problems:
HTML customization:
For example see the below ASPX code, can you guess what kind of HTML it will generate.
Label generates a SPAN , Literal generates simple text , Panel generates DIV tag
Note: To verify same, just request a page with above controls and see the view page source(Right Click and Select the Page Source in your browser).
Re-usability of code behind class:
If you watch any professional ASP.NET Web form project you will notice that code behind class is where you have huge amount of code and the code is really complicated.
Problem: We can't reuse the code behind class for other pages.
Solution for this problem: - “GET RID of SERVER CONTROLS and CODE BEHIND”.
Are you wondering, How these problems get resolved in Asp.Net MVC ?
Please see my blog post "MVC Request Flow".
No comments:
Post a Comment