WebForms vs. MVC

272 1 0
                                        

Introduction

It’s been a long time I have been working as an ASP.NET developer and I do enjoy writing web apps using web forms. 

In 2008 Microsoft came up with something called as ASP.NET MVC and I was quite amazed about the fact “Why one more ASP.NET technology required” and many people still pondering same.

Many people say ASP.NET MVC replaced ASP.NET Web Forms. But that’s not true.Both have their own pros and cons Nobody can tell or teach us what to use and when, but we can discuss about some facts which will help us to make choice between both of them. And this article contains same.

We also try to find answers for some questions like,

What is ASP.NET?

What is ASP.NET Web Forms?

What is MVC?

What is ASP.NET MVC?

If you are advanced or experienced ASP.NET MVC developer, who already know MVC very well then this article will help you to revise your concepts.

Index/Contents

Talk about Visual

Web Technologies

Visual in Web

What is ASP.NET?

What is Web Forms?

ASP.NET 4.0

What is MVC?

What is ASP.NET MVC?

Why ASP.NET Web Forms and Why ASP.NET MVC?

Conclusion

Talk about Visual

Microsoft initially came up with something called Visual. With the help of technologies like Visual Basic, Visual C++ Microsoft enabled RAD (rapid application development) of Graphical User applications. Features such as Drag and Drop and intellisense made developers to focus more on the business functionality of the application rather than on UI design. 

But this technologies were limited to desktops, when it comes to web the only option left with Microsoft was ASP.

Web Technologies

When we say web technologies, we have classic ASP, php, jsp,ROR, ASP.NET Web Forms, ASP.NET MVC and many more. Classic ASP is one of the web technology introduced by Microsoft.  Biggest pain point with the classic ASP was spaghetti code and maintainability. Let assume a scenario where you have some text boxes and a button. On button click you validate the data with the server and if validation succeeds data will be stored into database and in case it fails, error message will be shown to user in the form of red colored label. You know what’s the biggest problem with this scenario is? You have to do lots of stuffs by your own.

First make the self-post back by setting form’s action attribute’s value to same page.

Text box values are going to be cleared on button click, so only choice left will be retrieving values from posted data.

In case validation fails you have to explicitly Set all values back to the corresponding text boxes from posted data 

Show error message.

(Using Ajax is an alternate method. Here I was trying to explain the manual work need to be done with classic ASP)

Visual in Web

WebForms vs. MVCWhere stories live. Discover now