2009_2_02 how aspnet works

2009_2_02 how aspnet works - Chapter 2 How ASP.NET Works...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
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.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 How ASP.NET Works Overview ¾ ASP.NET Event Model ¾ ASP.NET Code Compilation ¾ The Page Class ¾ ASP.NET Application Lifecycle
Background image of page 2
3 How ASP.NET Works Event Model ¾ One of the key features of ASP.NET is that it uses an event-based programming model. ¾ In the simple Hello World example, we added a small bit of programming to a method named Page_Load . ¾ This method is an event handler . ¾ 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.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 How ASP.NET Works 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 EventArgs parameter ¾ (or a subclass of EventArgs , such as CommandEventArgs or ImageClickEventArgs ). protected void Page_Load(object sender, EventArgs e) { }
Background image of page 4
5 How ASP.NET Works ASP.NET Event System ¾ The event system in ASP.NET operates in a different manner than in a Windows application or from the event system in browser-based Javascript. ¾ In a Windows application, for instance, events are raised and handled on the same processor. ¾ In contrast, ASP.NET events are raised on the client (the browser) but transmitted to and handled on the server. ¾ Since its event handling requires a round-trip to the server, ASP.NET offers a smaller set of events in comparison to a totally client-based event system.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Chapter title here ASP.NET Event System
Background image of page 6
7 How ASP.NET Works Postback ¾ Postback is the process by which the browser posts information back to itself. ¾ That is, posts information back to the server by requesting the same page. ¾ Postback in ASP.NET only occurs within web forms (i.e., within a form element with runat=server), and only server controls post back information to the server. ¾ Each cycle in which information is displayed then posted back to the server, and then redisplayed again, is sometimes also called a round trip .
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Chapter title here Postback
Background image of page 8
9 How ASP.NET Works Event Types ¾ Two types ¾ Page events ¾ Always triggered and always in a certain specific order (see Page Lifecycle) ¾ Control events ¾ Associated with particular controls and only triggered in certain circumstances.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10 How ASP.NET Works
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/23/2011 for the course ENCS ENCS5 taught by Professor Abdelsalam during the Spring '10 term at Birzeit University.

Page1 / 34

2009_2_02 how aspnet works - Chapter 2 How ASP.NET Works...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online