Cool C # series: stay away from the web form, as far as possible

Occasionally wandering on some forums and programming groups, many people still have questions about WebForm. Well, I used to comment on WinForm and Silverlight before, so I went to WebForm today to give enough. The article will give you a reason to … give up WebForm and spend time learning something more useful.

Note : the article is the author's personal opinion . All technical discussions and suggestions on writing are welcome.

ASPNETlogo

WebForm, who are you? Which planet are you down?

Before saying the reason why you should stay away from WebForm, listen to me tell you about the life of an elephant in a dog full of ups and downs of WebForm.

Once upon a time, when most of the software users were businesses, the developers kept the Enterprise Application code for the company internally with WinForm and VB6.

Then one day, the Internet was born. Instead of just making internal applications, now leaders also require to put products on the web . Unfortunately, the company before now only has a bunch of developers specializing in WinForm. To write web applications, they must retrain in HTML / CSS / JS and back-end, which is very time-consuming and labor-intensive.

So Microsoft created WebForm. No need to learn HTML / CSS or JavaScript, people just apply some knowledge about WinForm, drag and drop control is able to create web applications, too convenient, right!

Web Form is quickly favored by every company. With the advent of a number of user controls made by KendoUI, DevExpress, drag and drop, designing web applications is convenient and fast.

kendo

Unfortunately, things changed, like Internet Explorer, WebForm's life also experienced many merchants. I have to bid farewell to the yogi, selling myself to the green floor, after being redeemed by the giants, I was jealous of my wife, … wrongly, reviewing the story of Kieu so I wrote it down . More than a year ago, WebForm was also killed by his father:

Why did WebForm die, what did you do wrong ?? Why did I tell you to stay away from the Web Form, please read on the second part, wrong, … below.

WebForm's weaknesses

Here are some reasons that WebForm is being scolded by people more than cursing dogs (To learn more, you can google "Why Web Form sucks").

  • WebForm's View State is usually quite large, sometimes up to even MB (containing information about all fields of the form), making sending and receiving data heavy.
  • Unable to manage the IDs of the created elements, it is difficult to integrate with jQuery (New WebForm versions have fixed this error).
  • Page Cycle is complicated to understand with 7 steps and nearly 10 events.
  • Some controls support writing fast code leading to reckless code (for example, allowing connection to Database directly from view).
  • Cannot apply DI, cannot write unit test.

However, this is only a weak point. (The weakness is that every language / framework has), not the reason I recommend not learning WebForm.

1 (1)

The reason should stay away from webform

The reason I recommend that you leave WebForm is not because I used to go to the green, so I have HIV, but: WebForm is currently very rarely used, and the knowledge gained from WebForm is very useless .

WebForm is a three-point guy, it uses the concept of user control to hide the truth about the web: Web nature * must be Form and Control, Web is HTML / CSS / JS . It gives you a feeling: Making the Web is as simple as the form, just drag and drop and write the code for the event is done.

Initially with simple functions or available code, WebForm works quite well, but when it comes to complex interaction with JavaScript, AJAX, RestAPI, WebForm gradually reveals its disadvantages.

first

On the other hand, most Web frameworks clearly separate the two components – front-end and back-end. If you have learned ASP.NET MVC, understand the model and controller, you can easily switch to Ruby on Rail, Struts, Django, Express, or apply MVC knowledge to front-end frameworks like AngularJS. Understand the concept of front end / back end you will be able to write RestAPI, write Single Page Application.

However, if you learn WebForm, you will have to learn from the beginning when switching to other frameworks such as MVC, Struts, … because no one uses the concepts of server control, page cycle … of WebForm. Well, it's not useless!

Conclude

In the past, I learned FPT and also taught Web Form. Although I do not know how to write HTML CSS, but drag and drop also create a very fast and virtual web. As a result, when I learn I don't know anything about HTML and CSS =)).

I also know that WebForm is a great technology , but it is not useful for your long-term development path .

1413830260-interview-questions

This article is written to warn those who have been or are going to learn WebForm. Remember carefully, don't invest too much effort in it !!

Give the correct number, so that the doctors told me to cut the wind =)))

first2

ITZone via toidicodedao

Share the news now