SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Chapter 2 How ASP.NET Works And slowly, softly, from above the darkness is unfurled A wondrous curtain loosened on the windows of the world. Then suddenly, like magic, … Ten thousand lights flash out … Alfred Chandler, “Lights along the Mile,”   The Oxford Book of Australian Verse,  ed. Walter Murdoch, 1918.
Overview ,[object Object],[object Object],[object Object],[object Object]
Event Model ,[object Object],[object Object],[object Object],[object Object],[object Object]
Event Handlers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],protected void Page_Load(object sender, EventArgs e) { … }
ASP.NET Event System ,[object Object],[object Object],[object Object],[object Object]
ASP.NET Event System
Postback ,[object Object],[object Object],[object Object],[object Object]
Postback
Event Types ,[object Object],[object Object],[object Object],[object Object],[object Object]
View State ,[object Object],[object Object],[object Object],<input type=&quot;hidden&quot; name=&quot;__VIEWSTATE&quot; id=&quot;__VIEWSTATE&quot;  value=&quot;/wEPDwUJODExMDE5NzY5D2QWAgIDD2QWAgIBDw8WAh4EVGV4dAUKMDgvMDE vMjAwNmRkZDZPhFHJER4chf3nmlgfL+uq4W58&quot; />
View State ,[object Object],[object Object],[object Object],[object Object]
View State ,[object Object],[object Object],[object Object]
View State ,[object Object],[object Object]
View State ,[object Object],[object Object],[object Object],[object Object]
Page Life Cycle ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Complete Page Life Cycle
Event Handlers ,[object Object],[object Object]
Event Handlers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],<asp:Button id=&quot;btnSubmit&quot; runat=&quot;server&quot;  OnClick=&quot;btnSubmit_Click&quot;  /> btnSubmit.Click += new EventHandler( this.btnSubmit_Click );
Adding Event Handlers in VS
Event Example Please enter your name: <asp:TextBox ID=&quot;name&quot; runat=&quot;server&quot; /> <br /> Choose favorite author: <asp:DropDownList ID=&quot;myList&quot; runat=&quot;server&quot;> <asp:ListItem>Choose an author</asp:ListItem> <asp:ListItem>Atwood</asp:ListItem> <asp:ListItem>Austin</asp:ListItem> <asp:ListItem>Hawthorne</asp:ListItem> <asp:ListItem>Melville</asp:ListItem> </asp:DropDownList> <br /> <asp:Button ID=&quot;btnEnter&quot; Text=&quot;Enter&quot; runat=&quot;server&quot;  OnClick=&quot;btnEnter_Click&quot;  /> <p><asp:Label ID=&quot;msg1&quot; runat=&quot;server&quot; /></p>
Event Example … public partial class EventTest: Page { protected void Page_Load(object sender, EventArgs e) { msg1.Text = &quot;In Page_Load<br/>&quot;; } protected void btnEnter_Click(object sender, EventArgs e) { if (myList.SelectedIndex > 0) { msg1.Text += &quot;Hi &quot; + name.Text + &quot;<br/>&quot;; msg1.Text += &quot;Your favorite author is &quot;; msg1.Text += myList.SelectedItem; } } }
Detecting Postback ,[object Object],[object Object],[object Object]
Detecting Postback ,[object Object],[object Object],protected void Page_Load(object sender, EventArgs e) { … if (!  IsPostBack ) { // Do something here for very first request } … }
Postback and Non-Postback Controls ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Change Events ,[object Object],[object Object],[object Object]
Using AutoPostBack Choose favorite author: <asp:DropDownList ID=&quot;myList&quot; runat=&quot;server&quot; AutoPostBack=&quot;true&quot;   OnSelectedIndexChanged=&quot;myList_SelectedIndexChanged&quot;  > <asp:ListItem>Choose an author</asp:ListItem> <asp:ListItem>Atwood</asp:ListItem> <asp:ListItem>Austin</asp:ListItem> <asp:ListItem>Hawthorne</asp:ListItem> <asp:ListItem>Melville</asp:ListItem> </asp:DropDownList> <p><asp:Label ID=&quot;msg1&quot; runat=&quot;server&quot; /></p> protected void myList_SelectedIndexChanged(object sender, EventArgs e) { // Ignore first item in list if (myList.SelectedIndex > 0) { msg1.Text += &quot;Hi &quot; + name.Text + &quot;<br/>&quot;; msg1.Text += &quot;Your favorite author is &quot;; msg1.Text += myList.SelectedItem; } }
ASP.NET Behind the Scenes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ASP.NET 2.0 Compilation Process
Where is this stuff? ,[object Object],[object Object],[object Object],C:INDOWSicrosoft.NETramework2.0.50727emporary ASP.NET Fileshapter2229f9fdd0746a9.
Page  class ,[object Object]
ASP.NET 2.0 Class Inheritance
Page  class ,[object Object],[object Object],[object Object]
Application Lifecycle ,[object Object]
Application Lifecycle

Weitere ähnliche Inhalte

Was ist angesagt? (18)

JSP Error handling
JSP Error handlingJSP Error handling
JSP Error handling
 
RicoAjaxEngine
RicoAjaxEngineRicoAjaxEngine
RicoAjaxEngine
 
Ajax and ASP.NET AJAX
Ajax and ASP.NET AJAXAjax and ASP.NET AJAX
Ajax and ASP.NET AJAX
 
Ajax control tool kit
Ajax control tool kitAjax control tool kit
Ajax control tool kit
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
Programming web application
Programming web applicationProgramming web application
Programming web application
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
 
Introduction to Ajax programming
Introduction to Ajax programmingIntroduction to Ajax programming
Introduction to Ajax programming
 
Html server control - ASP. NET with c#
Html server control - ASP. NET with c#Html server control - ASP. NET with c#
Html server control - ASP. NET with c#
 
Jquery Ajax
Jquery AjaxJquery Ajax
Jquery Ajax
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1
 
2310 b 06
2310 b 062310 b 06
2310 b 06
 
Asp
AspAsp
Asp
 
More Asp
More AspMore Asp
More Asp
 
ajax_pdf
ajax_pdfajax_pdf
ajax_pdf
 

Andere mochten auch

Microsoft SQL Server 2008
Microsoft SQL Server 2008Microsoft SQL Server 2008
Microsoft SQL Server 2008
Hossein Zahed
 

Andere mochten auch (16)

CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Big Data World
Big Data WorldBig Data World
Big Data World
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
 
ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015
 
HTML & XHTML Basics
HTML & XHTML BasicsHTML & XHTML Basics
HTML & XHTML Basics
 
CSharp Language Overview Part 1
CSharp Language Overview Part 1CSharp Language Overview Part 1
CSharp Language Overview Part 1
 
SEO Fundamentals
SEO FundamentalsSEO Fundamentals
SEO Fundamentals
 
Microsoft SQL Server 2008
Microsoft SQL Server 2008Microsoft SQL Server 2008
Microsoft SQL Server 2008
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
Introduction to angular js for .net developers
Introduction to angular js  for .net developersIntroduction to angular js  for .net developers
Introduction to angular js for .net developers
 
ASP .net MVC
ASP .net MVCASP .net MVC
ASP .net MVC
 
Technologies that will disappear in next 5 years
Technologies that will disappear in next 5 yearsTechnologies that will disappear in next 5 years
Technologies that will disappear in next 5 years
 
Basic c++ programs
Basic c++ programsBasic c++ programs
Basic c++ programs
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language
 
2008: Web Application Security Tutorial
2008: Web Application Security Tutorial2008: Web Application Security Tutorial
2008: Web Application Security Tutorial
 

Ähnlich wie ASP.NET 02 - How ASP.NET Works

Aspnet2 Overview
Aspnet2 OverviewAspnet2 Overview
Aspnet2 Overview
ajitbergi
 
Web Services Part 2
Web Services Part 2Web Services Part 2
Web Services Part 2
patinijava
 
Esposito Ajax Remote
Esposito Ajax RemoteEsposito Ajax Remote
Esposito Ajax Remote
ask bills
 

Ähnlich wie ASP.NET 02 - How ASP.NET Works (20)

Vb.Net Web Forms
Vb.Net  Web FormsVb.Net  Web Forms
Vb.Net Web Forms
 
2310 b 05
2310 b 052310 b 05
2310 b 05
 
Ajax
AjaxAjax
Ajax
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
 
Aspnet2 Overview
Aspnet2 OverviewAspnet2 Overview
Aspnet2 Overview
 
2 Asp Dot Net Ajax Extensions
2 Asp Dot Net Ajax Extensions2 Asp Dot Net Ajax Extensions
2 Asp Dot Net Ajax Extensions
 
AJAX ASP.Net
AJAX ASP.NetAJAX ASP.Net
AJAX ASP.Net
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
ASP.NET MVC
ASP.NET MVCASP.NET MVC
ASP.NET MVC
 
Event
EventEvent
Event
 
ASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation ControlsASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation Controls
 
Act as state machine
Act as state machineAct as state machine
Act as state machine
 
Web Services Part 2
Web Services Part 2Web Services Part 2
Web Services Part 2
 
Bronx study jam 2
Bronx study jam 2Bronx study jam 2
Bronx study jam 2
 
Struts2
Struts2Struts2
Struts2
 
Retrofitting
RetrofittingRetrofitting
Retrofitting
 
Managing states
Managing statesManaging states
Managing states
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
 
Esposito Ajax Remote
Esposito Ajax RemoteEsposito Ajax Remote
Esposito Ajax Remote
 
Ridingapachecamel
RidingapachecamelRidingapachecamel
Ridingapachecamel
 

Mehr von Randy Connolly

Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...
Randy Connolly
 

Mehr von Randy Connolly (20)

Celebrating the Release of Computing Careers and Disciplines
Celebrating the Release of Computing Careers and DisciplinesCelebrating the Release of Computing Careers and Disciplines
Celebrating the Release of Computing Careers and Disciplines
 
Public Computing Intellectuals in the Age of AI Crisis
Public Computing Intellectuals in the Age of AI CrisisPublic Computing Intellectuals in the Age of AI Crisis
Public Computing Intellectuals in the Age of AI Crisis
 
Why Computing Belongs Within the Social Sciences
Why Computing Belongs Within the Social SciencesWhy Computing Belongs Within the Social Sciences
Why Computing Belongs Within the Social Sciences
 
Ten-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS DegreeTen-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS Degree
 
Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)
 
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
 
Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)
 
Modern Web Development (2018)
Modern Web Development (2018)Modern Web Development (2018)
Modern Web Development (2018)
 
Helping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing DisciplinesHelping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing Disciplines
 
Constructing a Web Development Textbook
Constructing a Web Development TextbookConstructing a Web Development Textbook
Constructing a Web Development Textbook
 
Web Development for Managers
Web Development for ManagersWeb Development for Managers
Web Development for Managers
 
Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"
 
17 Ways to Fail Your Courses
17 Ways to Fail Your Courses17 Ways to Fail Your Courses
17 Ways to Fail Your Courses
 
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
 
Constructing and revising a web development textbook
Constructing and revising a web development textbookConstructing and revising a web development textbook
Constructing and revising a web development textbook
 
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing DisciplinesComputing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
 
Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...
 
Thinking About Technology
Thinking About TechnologyThinking About Technology
Thinking About Technology
 
A longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission dataA longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission data
 
Web Security
Web SecurityWeb Security
Web Security
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

ASP.NET 02 - How ASP.NET Works

  • 1. Chapter 2 How ASP.NET Works And slowly, softly, from above the darkness is unfurled A wondrous curtain loosened on the windows of the world. Then suddenly, like magic, … Ten thousand lights flash out … Alfred Chandler, “Lights along the Mile,” The Oxford Book of Australian Verse, ed. Walter Murdoch, 1918.
  • 2.
  • 3.
  • 4.
  • 5.
  • 7.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 17.
  • 18.
  • 20. Event Example Please enter your name: <asp:TextBox ID=&quot;name&quot; runat=&quot;server&quot; /> <br /> Choose favorite author: <asp:DropDownList ID=&quot;myList&quot; runat=&quot;server&quot;> <asp:ListItem>Choose an author</asp:ListItem> <asp:ListItem>Atwood</asp:ListItem> <asp:ListItem>Austin</asp:ListItem> <asp:ListItem>Hawthorne</asp:ListItem> <asp:ListItem>Melville</asp:ListItem> </asp:DropDownList> <br /> <asp:Button ID=&quot;btnEnter&quot; Text=&quot;Enter&quot; runat=&quot;server&quot; OnClick=&quot;btnEnter_Click&quot; /> <p><asp:Label ID=&quot;msg1&quot; runat=&quot;server&quot; /></p>
  • 21. Event Example … public partial class EventTest: Page { protected void Page_Load(object sender, EventArgs e) { msg1.Text = &quot;In Page_Load<br/>&quot;; } protected void btnEnter_Click(object sender, EventArgs e) { if (myList.SelectedIndex > 0) { msg1.Text += &quot;Hi &quot; + name.Text + &quot;<br/>&quot;; msg1.Text += &quot;Your favorite author is &quot;; msg1.Text += myList.SelectedItem; } } }
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. Using AutoPostBack Choose favorite author: <asp:DropDownList ID=&quot;myList&quot; runat=&quot;server&quot; AutoPostBack=&quot;true&quot; OnSelectedIndexChanged=&quot;myList_SelectedIndexChanged&quot; > <asp:ListItem>Choose an author</asp:ListItem> <asp:ListItem>Atwood</asp:ListItem> <asp:ListItem>Austin</asp:ListItem> <asp:ListItem>Hawthorne</asp:ListItem> <asp:ListItem>Melville</asp:ListItem> </asp:DropDownList> <p><asp:Label ID=&quot;msg1&quot; runat=&quot;server&quot; /></p> protected void myList_SelectedIndexChanged(object sender, EventArgs e) { // Ignore first item in list if (myList.SelectedIndex > 0) { msg1.Text += &quot;Hi &quot; + name.Text + &quot;<br/>&quot;; msg1.Text += &quot;Your favorite author is &quot;; msg1.Text += myList.SelectedItem; } }
  • 27.
  • 29.
  • 30.
  • 31. ASP.NET 2.0 Class Inheritance
  • 32.
  • 33.