9
Web Server Controls Web Server Controls MacDonald Ch. 5 MacDonald Ch. 5 MIS 324 Professor Sandvig

Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig

Embed Size (px)

Citation preview

Page 1: Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig

Web Server ControlsWeb Server ControlsMacDonald Ch. 5MacDonald Ch. 5

MIS 324Professor Sandvig

Page 2: Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig

TodayToday

Benefits of Server ControlsBenefits of Server ControlsOverview of HTML-like controlsOverview of HTML-like controlsControls unique to ASP.NETControls unique to ASP.NETData-listing controlsData-listing controlsExampleExample

Page 3: Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig

ASP.NET ControlsASP.NET Controls

Page 4: Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig

Benefits of Server ControlsBenefits of Server Controls

Objects with many properties & methodsObjects with many properties & methods Events:Events:

onTextChangedonTextChanged onCheckedChangedonCheckedChanged onClick…onClick…

Data stored in viewstateData stored in viewstate Validation controlsValidation controls

Client & server validationClient & server validation

Page 5: Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig

HTML-like controlsHTML-like controls

Correspond to HTML tags:Correspond to HTML tags:TextboxTextbox

textareatextareaButtonButtonCheckboxCheckboxRadiobuttonRadiobuttonDropDownDropDownImageImageHyperlinkHyperlinkLabelLabel

Page 6: Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig

Other ControlsOther Controls

LinkButton controlLinkButton control Looks like hyperlinkLooks like hyperlink Acts like a button (postback)Acts like a button (postback)

Panel ControlPanel Control Use to hide/show groups of controlsUse to hide/show groups of controls

Visible propertyVisible property Can still access & change hidden control Can still access & change hidden control

propertiesproperties Use frequentlyUse frequently

Page 7: Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig

DataListing ControlsDataListing Controls

Datalisting controlsDatalisting controls Typically fill from datasourceTypically fill from datasource

RadioButtonListRadioButtonListCheckBoxListCheckBoxListGridViewGridViewRepeaterRepeaterDetailsViewDetailsViewFormViewFormView

Example: Example: CheckBoxListControl.aspx (source)(source)

Discuss in Ch. 13 ADO.NETDiscuss in Ch. 13 ADO.NET

Page 8: Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig

ExamplesExamples

Controls Used:Controls Used:Panel, textbox, button, dropdown list, Panel, textbox, button, dropdown list,

checkbox list, hyperlink, label, required field checkbox list, hyperlink, label, required field validator, custom validator validator, custom validator

Baker Snowboard: source, outputBaker Snowboard: source, output

Page 9: Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig

Web Form SummaryWeb Form Summary

Web Server controls write HTMLWeb Server controls write HTML Benefits:Benefits:

ViewstateViewstate Programmatic accessProgrammatic access

PropertiesPropertiesEventsEventsMethodsMethods

Validation controlsValidation controls