Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig
Today Benefits of Server Controls Benefits of Server Controls Overview of HTML-like controls Overview of HTML-like controls Controls unique to ASP.NET Controls unique to ASP.NET Data-listing controls Data-listing controls Example Example
ASP.NET Controls
Benefits of Server Controls Objects with many properties & methods Objects with many properties & methods Events: Events: onTextChanged onTextChanged onCheckedChanged onCheckedChanged onClick… onClick… Data stored in viewstate Data stored in viewstate Validation controls Validation controls Client & server validation Client & server validation
HTML-like controls Correspond to HTML tags: Correspond to HTML tags: Textbox Textbox textarea textarea Button Button Checkbox Checkbox Radiobutton Radiobutton DropDown DropDown Image Image Hyperlink Hyperlink Label Label
Other Controls LinkButton control LinkButton control Looks like hyperlink Looks like hyperlink Acts like a button (postback) Acts like a button (postback) Panel Control Panel Control Use to hide/show groups of controls Use to hide/show groups of controls Visible property Visible property Can still access & change hidden control properties Can still access & change hidden control properties Use frequently Use frequently
DataListing Controls Datalisting controls Datalisting controls Typically fill from datasource Typically fill from datasource RadioButtonList RadioButtonList CheckBoxList CheckBoxList GridView GridView Repeater Repeater DetailsView DetailsView FormView FormView Example: CheckBoxListControl.aspx (source) Example: CheckBoxListControl.aspx (source)CheckBoxListControl.aspxsourceCheckBoxListControl.aspxsource Discuss in Ch. 13 ADO.NET Discuss in Ch. 13 ADO.NET
Examples Controls Used: Controls Used: Panel, textbox, button, dropdown list, checkbox list, hyperlink, label, required field validator, custom validator Panel, textbox, button, dropdown list, checkbox list, hyperlink, label, required field validator, custom validator Baker Snowboard: source, output Baker Snowboard: source, outputsourceoutputsourceoutput
Web Form Summary Web Server controls write HTML Web Server controls write HTML Benefits: Benefits: Viewstate Viewstate Programmatic access Programmatic access Properties Properties Events Events Methods Methods Validation controls Validation controls