Introduction to Server Controls

Every server control has a tag with the runat="server" attribute and is converted to a client specific XHTML.ASP.NET server controls are object and have their own properties method and event handlers. The most useful inherited properties are:
  • Controls: gives a collection with all child controls for a specified server control
  • EnableViewState: boolean to decide whether the controls has to track his current state or not
  • ID: id of the server control,maybe the most important property
  • Visible: boolean to decide if the controls will be rendered
The most useful inherited methods are:
  • DataBind(): binds the controls with a certain data source (e.g resultset of an sql query)
  • FindControl(): searches a child control with the given name(string)
  • HasControls(): boolean that define if this server control owns child controls

No comments:

Post a Comment