What's a webform

laptop

ASP.NET web forms are part of the ASP.NET web application infrastructure and are included with Visual Studio. It is one of the four programming models that you can use to build ASP.NET web applications, the others being ASP.NET MVC, ASP.NET web pages, and ASP.NET single-page applications.

Web forms are pages that your users request in their browser. These pages can be written using a combination of HTML, client-side scripting, server-side controls, and server-side code. When users request a page, it is compiled and executed on the server by the framework, and then the framework generates the HTML markup that the browser can display. An ASP.NET web form page provides information to a user in any browser or client device.

ASP.NET web forms are:

  • Based on Microsoft’s ASP.NET technology, in which code running on the server dynamically generates the output of a web page to a browser or client device.
  • It is compatible with any browser or mobile device. An ASP.NET web page automatically displays the correct browser-compatible HTML for features such as styles, layout, and more.
  • Compatible with any language supported by the .NET runtime, such as Microsoft Visual Basic and Microsoft Visual C#.
  • Built on top of the Microsoft .NET Framework. This provides all the benefits of the framework, including a managed environment, type safety, and inheritance.
  • Flexibility, as you can add controls created by users and third-party developers.

ASP.NET web forms offer:

  • Separation of HTML and other user interface code from the application logic.
  • A rich set of server controls for common tasks, including data access.
  • Powerful data binding with excellent tool support.
  • Support for client-side scripting that runs in the browser.
  • Support for a range of other features, including routing, security, performance, internationalization, testing, debugging, error handling, and state management.

ASP.NET web forms help you overcome challenges

Programming web applications poses challenges that don’t typically arise when programming traditional client applications. Among the challenges:

  • Implementing an advanced web user interface . Developing and implementing a user interface using basic HTML capabilities can be difficult and tedious, especially if the page has a complex layout, a large amount of dynamic content, and fully functional user interaction objects.
  • Separation of client and server. In a web application, the client (browser) and server are different programs that often run on different computers (and even different operating systems). Consequently, the two halves of the application share very little information; they can communicate, but usually only exchange small portions of simple information.
  • Non-stateful execution. When a web server receives a request for a page, it finds the page, processes it, sends it to the browser, and then discards all information about the page. If the user requests the same page again, the server repeats the entire sequence, re-processing the page from scratch. In other words, the server has no memory of the pages it has processed – the pages have no state. Therefore, if a program needs to store information about a page, its stateless nature can be a problem.
  • Unknown client capabilities . In many cases, web applications are available to many users who use different browsers. Browsers have different capabilities, which makes it difficult to create an application that works equally well on all of them.
  • Difficulties with accessing data. Reading from a data source and writing to traditional web applications can be difficult and resource-intensive.
  • Difficulties with scalability. In many cases, web applications developed using existing methods do not meet scalability goals due to a lack of compatibility between different components of the application. This is often a common failure point for applications with intense growth cycles.