Internet Application Development

FIT5032: Week 5

Week 5 of Internet Application Development began our move towards dynamic page development. The topics covered were:

  • HTTP protocol review
  • HTML forms review
  • ASP.NET Standard server controls
  • Event driven programming and postback

As HTTP has been covered in detail through FIT9020 Data Communications I will skip this topic, noting that it is a stateless protocol. The diagram below illustrates how pages are processed from HTTP requests:

HTML forms use either the GET or POST methods for delivering information from the form in either the URL, or the HTTP body.  We ran through some simple examples of HTML forms

ASP.NET server controls enable the use of data from forms alongside databases, PHP, JSP and CGI scripts are some other technologies offering this ability. It must be noted that ASP.NET forms always use the POST method and overcome HTTP’s stateless characteristic by using _VIEWSTATE. The next section of the lecture covered the server controls which can be used in place of HTML form elements. The examples covered used postback methods to echo data selections from ASP.NET forms.

The final topic of the lecture was events and postback.

ASP.NET has some events which it can generate itself:

  • Page_Init() – occurs the first time the page is loaded but not on postbacks
  • Page_Load() – occurs the first time the page is loaded and on postbacks
  • Control Events – user clicking a checkbox dealt with when postback occurs
  • Page_Unload()- good for housekeeping

User initiated events are:

  • onload – happens when the control has loaded into the window or frame (Not to be confused with Page_Load() which happens when the whole page has loaded)
  • onunload – happens when the control has been unloaded from the window or frame
  • onclick – happens when a mouse button is clicked over an <asp:button> control
  • oninit – happens when the web page is first initialised
  • onprerender – happens just before the control is rendered
  • selectindexchanged and checkchanged

The lecture then covered some examples of user initiated events and how to write C# handler code for those events.

Leave a Reply

Your email address will not be published. Required fields are marked *