Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Web Forms and ASP.NET Web Pages

What is the difference between ASP.NET Web Forms and ASP.NET Web Pages?

Here it says that Web Pages and Web Forms are different approaches.

like image 310
SocialCircus Avatar asked May 27 '11 10:05

SocialCircus


People also ask

What is the difference between ASP.NET Web Forms and ASP NET web pages?

Yes, there is a major difference between the Web Pages framework and Web Forms. Web Forms uses server controls and the programming experience is more like working with Windows Forms and controls. Web Pages is very much like PHP or classic ASP and lets you work much closer to HTML and HTTP.

What is ASP Net web pages?

ASP.NET Web Pages is a framework that you can use to create dynamic web pages. A simple HTML web page is static; its content is determined by the fixed HTML markup that's in the page. Dynamic pages like those you create with ASP.NET Web Pages let you create the page content on the fly, by using code.

What is web page and web form?

WebPage is a document / information resource that is rendered usually as HTML/XHTML on World Wide Web and is accessed through Web Browser. Whereas, Web Form is a document where you can design and develop the Web Page, Web Form usually provides features which can enable a user to develop a Web Page.

Is ASP.NET Web Forms?

ASP.NET is a potent and popular web form with various features like routing, security, etc. It gives a wide range of authentication systems for web applications and provides its own tags for different functionality. It supports user registration, event handling, model binding, and server control.


1 Answers

There are three flavors of ASP.NET Full and there is also ASP.NET Core (the new one that works on Linux and Mac).

For ASP.NET Full

The first one is the oldest and is called Web Forms. Basically it is a high-level component-oriented web framework that works with controls like buttons and grids that encapsulate behaviour and view.

It was the most popular flavor of ASP.NET, but it has been criticised for the lack of control over the generated markup. Currently most new projects are ASP.NET MVC, but there is definitely a lot of Web Forms code out there. While this is my personal favorite, I must point out that it is a bad way to start learning web programming, because it hides the implementation details from you (which is good when you have experience) and is a bit complex to learn.

Source: http://www.asp.net/web-forms

ASP.NET MVC is an implementation of the MVC pattern for ASP.NET. Some people claim that it is easier to develop maintainable applications with unit tests and good separation of concerns with this framework than it is with Web Forms.

I disagree on this point and think that using patterns like MVP one can achieve the same with Web Forms. On the other hand, ASP.NET MVC has one big advantage - it allows full control over the generated markup. This is very important for the modern style of web development where a lot of things are controlled with JavaScript. For example, adding a fancy animation is easier to do on top of an MVC view than it is on top of a Web Form.

Source: http://www.asp.net/mvc

ASP.NET Web Pages is a (currently) the latest flavor that is targeted at smaller project and beginner developers (at least in my opinion). It is good for developing smaller projects with ~ 10 pages. Most of the logic is written in a single file per page in what I call "Basic PHP style". It uses the Razor syntax for injecting the serverside code.

Source: http://www.asp.net/web-pages

Note that Web Forms uses pages (unlike MVC), and therefore there is a confusion what ASP.NET Web Pages is.

For ASP.NET Core, a new version of ASP.NET MVC is used that is conceptually the same as the ASP.NET MVC described above. Interestingly, as of ASP.NET Core 2.0, there is also something called Razor Pages which is essentially a more advanced version of ASP.NET Web Pages.

like image 148
Stilgar Avatar answered Sep 28 '22 03:09

Stilgar