1 / 10

ASP.NET Web Server Controls

ASP.NET Web Server Controls. Basic Web Server Controls. Overview. The ASP.NET page framework includes a number of built-in server controls that are designed to provide a more structured programming model for the Web. These controls provide the following features : Automatic state management.

kira
Download Presentation

ASP.NET Web Server Controls

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ASP.NET Web Server Controls Basic Web Server Controls

  2. Overview • The ASP.NET page framework includes a number of built-in server controls that are designed to provide a more structured programming model for the Web. These controls provide the following features: • Automatic state management. • Simple access to object values without having to use the Request object. • Ability to react to events in server-side code to create applications that are better structured. • Common approach to building user interfaces for Web pages. • Output is automatically customized based on the capabilities of the browser.

  3. ASP.NET Web Server Controls • Server controls are added to a page, and programmers write code to handle events raised by users’ interaction with the controls at runtime. • Built in Server controls are divided into two groups: • HTML controls • Reside in the System.Web.UI.HTMLControls namespace • Map 1-to-1 with the standard HTML elements • Web controls • Reside in the System.Web.UI.WebControlsnamespace • All Web controls use the prefix asp

  4. Web Server Control Categories • Basic Web Controls • Commonly used user input controls such as labels, text boxes, and drop-down lists • Validation Controls • used to validate the values that are entered into other controls of the page • perform client-side validation, server-side validation, or both • List Controls • support binding to collections • display rows of data in a customized format • Rich Controls • task-specific controls with rich functionality • Examples: AdRotatorand Calendar controls

  5. Basic Web Server Controls • Label • TextBox • CheckBox • RadioButton • DropDownList • Image • Panel • Button • HyperLink • ImageButton • LinkButton • Literal • PlaceHolder • Table • TableCell • TableRow

  6. Using Web Server Controls • Add server control to page • Set server control properties • Add event handler if needed

  7. Web Server Control Properties • The System.Web.UI.WebControls.WebControl base class contains all of the common properties. Most of the Web server controls derive from this class. • See the next slide for a list of common properties.

  8. Event Model • One of the key features of ASP.NET is that it uses an event-based programming model. • An event handler is a method that determines what actions are performed when an event occurs, such as when the user clicks a button or selects an item from a list. • When an event is raised, the handler for that specific event is executed

  9. Event Handlers • In the .NET Framework, all event handlers have a specific method signature, that is, a specific return type and parameters. • Event handlers are always void methods. • Event handlers always accept two parameters: • an object parameter • an EventArgsparameter (or a subclass of EventArgs, such as CommandEventArgs or ImageClickEventArgs).

More Related