Saturday, September 12, 2009

Chapter 2-Lesson 1

  • All server controls including the Page class derive from System.Web.UI.Control class.
  • ViewState data is not stored on the web server. It is sent as part of the response to the user.
  • PreInit event might be used to create dynamic controls or set masterpage and theme dynamically from code.
  • Init might be used to initialize values for dynamically created controls.
  • ViewState (if any) is retrieved before Load event.
  • Therefore, Load event may be used to check IF the page has been posted back. The Page is in stable state while this event is fired.
  • If the page is posted back, the Control events are processed after Load event.
  • Any changes made to controls during PreRender event are saved to ViewState.
  • Render is a method and NOT an event. It renders the client-side HTML for every control that it runs upon.
  • HTML Server controls are slightly different from ordinary HTML elements in that they have runat="server" and id attribute defined in them. ASP.NET generates an object instance for each HTML Server Control on the server.
  • Use HTML Server Controls when using custom Javascript for a particular control on the form.
  • When converting DIV element to HTML Server Control, we may use InnerText and InnerHTML properties through code.
  • All HTML and Web Server Controls need to be placed inside a Form with runat="server".
  • All postponed control events are raised before the event that actually caused the postback during page life-cycle.
  • The UniqueID property of a control contains its fully qualified name (i.e. NamingContainer(s) Assigned ID + Control ID)

No comments:

Post a Comment