Web Forms

Write short notes on web forms .

Just as the Win Forms provide a unified way of developing GUI for desktop application, the Web Forms provide similar tool for web applications. Web Forms has been introduced in .NET as a part of ASP.NET. Web Forms are a form engine, that provides a browser-based user interface.

To appreciate Web Forms you may consider how GUI is rendered in current Web applications. The GUI is rendered by using HTML tags. (e.g. <input type=text name=editboxl maxlength=10 size=10 >, will draw an edit box on the web page) Web Forms can also have the intelligence to use HTML, DHTML, and WML etc. to draw the controls on the web page based on the browser's capabilities. Web Forms can also incorporate the logic behind these controls. It’s like hooking up the code to a GUI control. Just like in your VB application, you can associate a code with a button on the web page; this code will be run on the server when the button is pressed. This is in contrast to the scripts that run on the clients when a button is pressed.

This approach is different to the Java approach. In Java a programmer can simulate this functionality through JavaScript and Servlets. But with Web forms this is done transparently.

A Java programmer may consider as if each HTML control has its dedicated "Servlets" running in the background. Every time the control receives any event of interest (e.g. button pressed, selection changed etc.) this specific "Servlets" is called. This results in much cleaner code and an excellent logic separation between presentation and business logic layers.

Web Forms consist of two parts - a template, which contains HTML-based layout information for all the GUI elements and a Component which contains all the logic to be hooked to the controls or GUI elements. This provides a neat presentation layer and application logic layer separation.

The GUI will be rendered on the client side, while the code that has been hooked to the GUI elements will run on the server side (very 'much likes a button being pressed on a JSP and a Servlets being called in response. But with Win Forms this has been made extremely easy). The incorporation of Web Forms in ASP.NET is an attempt to take ASP to a new level where it can seriously challenge JSP.

Another good feature of Web Forms is that it can be built to have enough intelligence to support a vast variety of browsers. The same ASP page would render itself using DHTML, if the browser is IE 5.5. But if the browser is Netscape the web page will be rendered using HTML tags; if the' page is being accessed through a WAP device the same page will render itself using WML tags.

One of the obvious disadvantages of ASP over Java was that there was that an ASP code was a maintenance nightmare. While a Java programmer can use Java Beans, Tags and also Servlets to achieve presentation and business layer separation - no such mechanism was present to an ASP programmer. With ASP.NET Microsoft 'has provided such presentation business, layer separation - by introducing the concept of Web Forms:

1. ASP.NET Web Forms provide an easy and to build dynamic Web UI.

2. ASP.NET Web Forms pages can target any browser client (there are no script library or. cookie requirements).

3. ASP.NET Web Forms pages· provide syntax compatibility with existing ASP pages.

4. ASP.NET server controls provide an easy way to encapsulate common functionality.

5. ASP.NET ships with 45 built-in server controls. Developers can also use controls built by third parties.

6. ASP.NET templates provide an easy way to customize the look and feel of list server controls.

7. ASP.NET validation controls provide an easy way to do declarative client ·or server data validation.

Leave Comment

Important Topics

CLI ( Common Language Infrastructure)
Microsoft Visual Studio
Web Forms
Console Application
Garbage Collection
Cross Language Integration
Dot Net Framework
Components of Dot Net
CLR - Common Language Run Time
FCL ( Framework Class Library )
CTS ( Common Type System )
CLS Common Language Specification
MSIL ( Microsoft Intermediate Language )
JIT ( Just in Time compiler)
Dot Net Introduction
Dot Net Structure