Sunday, 20 May 2012

difference between response.redirect and server.transfer

  • In Server.transfer their is no round trip while Response.redirect has a round trip hence puts a load on the server.
  • Using Sever.transfer you cannot redirect to a different server itself while using Response.redirect you can redirect to a different server also.

Page Life Cycle in asp.net

Page Event Use of Event
   
PreInit
  • Check The IsPostBack Property.
  • Create and Recreate dynamic controls.
  • .Set master page and themes.
Init
  • Initialize control properties and skin settings.
  • it is used to read and write all properties.
InitComplete
  • Tracking of view state changes is turned on
PreLoad
  • Raised after the page loads view state
  • process Request Instance.
PageLoad
  • The Page object calls the OnLoad method on the Page object
  • Set Property in controls.
  • establish database connections.
Control events
  • Use these events to handle specific control events, such as a button control's Click event or a TextBox control's TextChanged event.
LoadComplete
  • Raised at the end of the event-handling stage.
PreRender
  • created all controls
PreRenderComplete
  • Raised after each data bound control whose DataSourceID property is set calls its DataBind method.
SaveStateComplete
  • Raised after view state and control state have been saved for the page and for all controls.
Unload
  • Raised for each control and then for the page.
  • In controls, use this event to do final cleanup for specific controls, such as closing control-specific database connections.