Uncategorized


Asp.net supports the automatic event fire up. This will raise the relevant methods in the code behind to execute automatically since by default the auto event fire up is true.

Preinit:

· Checks whether the page is a post back

· Create or recreate the web controls dynamically

· Set the theme and the master page.

· Set profile property values

Init

· Read and initialize the control properties.

InitComplete

· processing tasks that require all initialization be complete

PreLoad(before the Load)

· loads view state for itself and all controls

· processes any postback data

Load

· Raise OnLoad event method and all the on load events for all the child controls with in the page.

· set properties in controls

· establish database connections (if any)

LoadComplete

· Loads other controls on the page

PreRender

· make final changes to the contents of the page or its controls

SaveStateComplete

· changes to the page or controls at this point will be ignored

· perform tasks to save the view state

Render

· Page object calls this method on each control

· User control automatically incorporates rendering

Unload

· Do final cleanup for specific controls and the page(Close control specific DB connections, closing open files, finishing up logging)

In a page life cycle it is important to understand the stages of the life cycle in order to write the proper coding at the proper stage of the page life cycle.

It performs a series of processing steps

  • · Initialization
  • · Initiating controls
  • · Restoring
  • · Maintain state
  • · Running event handlers
  • · Rendering.

Stages of the page life cycle:-

Page request – User request a web page and it passed to the server and the server determines whether the page need to be compiled and send or cached version can be invoked instead compilation.

Start – Page properties are set and determine whether it is a post back or not. Some of the properties are as follows

· Request

· Response

· IsPostBack

· UICulture

Page initialization– All the controls are available to and the unique id property is also set during this stage. All the themes are applied here; View state values will be yet to be loaded by this stage. So there will be no data on the page.

Load -Properties of all the controls and the data from the view state are being loaded during this stage. This stage can be used for the data binding of the page.

Validation -The validate methods of the validater controls are being called and all the validation are checked, while the isvalid property is being set.

Postback event handling – any the event handlers are being called.

Rendering Page render method for each of the controls are being called, which provides a text writer to the output stream of the page in response.

Unload This is called after the page if being rendered and all the writers are sent to the client. All The response and request are unloaded and the cleanup is performed.

refernce:-msdn

I got this error once try to run IIS on my machine.There were couple of causes  that it meant to be. The most probable cause was that I was having some other application running on port  80  which IIS was supposed to run.

So the solution was to change the IIS’s port