WEB forms

Close Index

ASP.NET compared with Classic ASP (source: Wikipedia)

ASP.NET WebForms simplifies developers' transition from Windows application development to Web development by offering the ability to build pages composed of controls similar to a Windows user interface. A Web control, such as a button or label, functions in very much the same way as its Windows counterparts: code can assign its properties and respond to its events. Controls know how to render themselves: whereas Windows controls draw themselves to the screen, web controls produce segments of HTML and JavaScript that form parts of the resulting page sent to the end-user's browser.

ASP.NET WebForms encourages the programmer to develop applications using an event-driven GUI model, rather than in conventional Web-scripting environments like ASP and PHP. The framework combines existing technologies such as JavaScript with internal components like "ViewState" to bring persistent (inter-request) state to the inherently stateless Web environment.


What are Web Forms (source: Microsoft)

ASP.NET Web Forms are:

  • Based on Microsoft ASP.NET technology, in which code that runs on the server dynamically generates Web page output to the browser or client device.
  • Compatible with any browser or mobile device. An ASP.NET Web page automatically renders the correct browser-compliant HTML for features such as styles, layout, and so on.
  • Compatible with any language supported by the .NET common language runtime, such as Microsoft Visual Basic and Microsoft Visual C#.
  • Built on the Microsoft .NET Framework. This provides all the benefits of the framework, including a managed environment, type safety, and inheritance.
  • Flexible because you can add user-created and third party controls to them.

ASP.NET Web Forms offer:

  • Separation of HTML and other UI code from application logic.
  • A rich suite of server controls for common tasks, including data access.
  • Powerful data binding, with great tool support.
  • Support for client-side scripting that executes in the browser.
  • Support for a variety of other capabilities, including routing, security, performance, internationalization, testing, debugging, error handling and state management.

Code examples

Examples demonstrate form validation in web browser using JavaScript and WebForms's CodeBehind approach when a server-side code in form of a DLL is executed. (CodeBehind is a regular .NET code like VB/C# instead of JavaScript)

Last updated: February 2020