web form fundamentals macdonald ch. 5 mis 324 mis 324 professor sandvig professor sandvig
TRANSCRIPT
![Page 1: Web Form Fundamentals MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig](https://reader036.vdocuments.mx/reader036/viewer/2022071807/56649dca5503460f94ac0aff/html5/thumbnails/1.jpg)
Web Form FundamentalsWeb Form FundamentalsMacDonald Ch. 5MacDonald Ch. 5
MIS 324
Professor SandvigProfessor Sandvig
![Page 2: Web Form Fundamentals MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig](https://reader036.vdocuments.mx/reader036/viewer/2022071807/56649dca5503460f94ac0aff/html5/thumbnails/2.jpg)
OutlineOutline
Web FormsWeb Forms– Three sectionsThree sections
Order of ExecutionOrder of Execution
ViewstateViewstate
![Page 3: Web Form Fundamentals MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig](https://reader036.vdocuments.mx/reader036/viewer/2022071807/56649dca5503460f94ac0aff/html5/thumbnails/3.jpg)
Web FormsWeb Forms
![Page 4: Web Form Fundamentals MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig](https://reader036.vdocuments.mx/reader036/viewer/2022071807/56649dca5503460f94ac0aff/html5/thumbnails/4.jpg)
1. Page Directives1. Page Directives
Set page propertiesSet page properties– Language, debugging, tracing, …Language, debugging, tracing, …
Import additional class librariesImport additional class libraries– Common ones imported automaticallyCommon ones imported automatically– Additional:Additional:
Database access, data manipulation, web Database access, data manipulation, web services, drawing, communication…services, drawing, communication…
![Page 5: Web Form Fundamentals MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig](https://reader036.vdocuments.mx/reader036/viewer/2022071807/56649dca5503460f94ac0aff/html5/thumbnails/5.jpg)
2. Code Declaration Blocks2. Code Declaration Blocks
Syntax:Syntax:<script runat=“server”><script runat=“server”>
//Server-side code here…//Server-side code here…
</script></script>
Locate:Locate:– Anywhere on page Anywhere on page usually at top usually at top– Another file Another file Code-Behind Code-Behind
![Page 6: Web Form Fundamentals MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig](https://reader036.vdocuments.mx/reader036/viewer/2022071807/56649dca5503460f94ac0aff/html5/thumbnails/6.jpg)
3. Code Render Block3. Code Render Block
Contain:Contain:– HTMLHTML– TextText– Server ControlsServer Controls
Typically located below Code blockTypically located below Code block– Location does not affect outputLocation does not affect output
![Page 7: Web Form Fundamentals MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig](https://reader036.vdocuments.mx/reader036/viewer/2022071807/56649dca5503460f94ac0aff/html5/thumbnails/7.jpg)
OutlineOutline
Web FormsWeb Forms– Three sectionsThree sections
Order of ExecutionOrder of Execution
ViewstateViewstate
![Page 8: Web Form Fundamentals MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig](https://reader036.vdocuments.mx/reader036/viewer/2022071807/56649dca5503460f94ac0aff/html5/thumbnails/8.jpg)
Order of ExecutionOrder of Execution .NET is event driven.NET is event driven
– Events include:Events include: Page loadPage load Button clickButton click checkbox checkedcheckbox checked textbox text changedtextbox text changed etc.etc.
We write handlers (methods) to handle eventsWe write handlers (methods) to handle events Events fired in sequenceEvents fired in sequence Page Life Cycle overview (for the curious)Page Life Cycle overview (for the curious)
Examples: Examples: – PostBack.aspx handoutPostBack.aspx handout
![Page 9: Web Form Fundamentals MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig](https://reader036.vdocuments.mx/reader036/viewer/2022071807/56649dca5503460f94ac0aff/html5/thumbnails/9.jpg)
OutlineOutline
Web FormsWeb Forms– Three sectionsThree sections
Order of ExecutionOrder of Execution
ViewstateViewstate
![Page 10: Web Form Fundamentals MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig](https://reader036.vdocuments.mx/reader036/viewer/2022071807/56649dca5503460f94ac0aff/html5/thumbnails/10.jpg)
ViewStateViewState
Saves control dataSaves control data– Encoded in hidden form fieldEncoded in hidden form field
Benefit: convenienceBenefit: convenienceDisadvantageDisadvantage– Processing overheadProcessing overhead– BandwidthBandwidth– NovusHRNovusHR
Turn off with:Turn off with:– EnableViewState=“false”EnableViewState=“false”
Individual controlsIndividual controlsPage (in page directive)Page (in page directive)
![Page 11: Web Form Fundamentals MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig](https://reader036.vdocuments.mx/reader036/viewer/2022071807/56649dca5503460f94ac0aff/html5/thumbnails/11.jpg)
Web Form SummaryWeb Form Summary
Designed to separate code and Designed to separate code and presentationpresentation
Event drivenEvent driven– User eventsUser events– Page eventsPage events
Granular control of event handlingGranular control of event handling
Viewstate provides convenienceViewstate provides convenience