Skip to main content

Concepts of different controls used in Web Pages.

Web controls are basically HTML elements wrapped under easy to use scripting tags of ASP+ and provide rich functionality in your FORMs or pages. Web controls range from simple text box to advance girds and lists. Some of the controls like data grid can be bound to data sources much like Visual Basic data bound controls.

What are advantages of web controls ?

  • They are highly customizable and provide common properties and methods throughout.
  • Even though web controls provide rich functionality finally they are rendered as plain HTML in the client browser thus avoiding browser compatibility problems.
  • They can be used in object oriented manner much like Visual Basic controls.
  • They are processed at server side. This makes ASP+ page much readable and cleaner as compared to traditional ASP page.
  • They can be data bound
  • State maintenance is automatically taken care by ASP+

What are common web controls available?

Following is a list of common web controls :

  • Label
  • Panel
  • Button
  • TextBox
  • CheckBox
  • RadioButton
  • RadioButtonList
  • ListBox
  • DropDownList
  • Table/TableRow/TableCell
  • DataGrid
  • DataList
  • Repeater
  • Calender
  • Validation controls

 

How do I handle Web control events?

Web control are processed at server side. This means that all the events generated by a control will be handled at server end. The event handling has changed with ASP+. Each event handler now has following syntax :

public sub myeventhandler(source as Object, evt as EventArgs)
'access your web controls here and
'manipulate their properties
end sub

Here, source is the object which caused the event to be raised and evt is an object providing more information about the event.

Note : I could not found clearly how to use these parameters from NGWS preview SDK. Also, it is not clear how to pass my own parameters to the event handlers.

What precautions are needed while coding for web controls ?

  • All controls must have id attribute set
  • All controls must be set to process at server side
  • All controls must be enclosed within HTML FORM element

The form must be set to process server side
All controls must have proper start and end tags i.e. <control></control> or <control />
If you want to maintain control state you must use POST method