Monday, September 14, 2009

Chapter 2-Lesson 3

  • Label control is rendered as tag while Literal control is rendered as static text. Therefore we can't apply CSS to Literal control.
  • PassThrough property of Literal control renders the specified text as it is to the browser and it is upon the browser to determine how to render output from it. Encode property would first convert any HTML tags and Javascript to appropriate HTML characters before rendering final HTML. Transform would check the target browser and remove any unsupported tags from the text.
  • Use Table, TableRow and TableCell controls to dynamically create/add tables, rows or columns to a page (maybe during Pre_Init). However, these dynamically added stuff would not persist during Postback.
  • Table contains Rows collection, and each TableRow contains a Cells collection.
  • Image control inherits from WebControl class, and ImageMap and ImageButton inherit from Image class.
  • GenerateEmptyAlternateText property of the Image control, if set to true, could be useful for generating accessible images that typically don't contribute to the meaning of the webpage. These would normally be ignored by non-visual page readers.
  • ImageButton's Click event contains a ImageClickEventArgs parameter which can be used to retrieve x and y coordinates of the user's click.
  • ImageMap differs from ImageButton in that it allows specification of Hotspots which would cause Postback from the image. On the other hand, clicking anywhere on the ImageButton causes a Postback.
  • Hotspots can be Circular, Rectangular or Polygonal.
  • HotspotMode.Postback tells a Hotspot to cause a Postback while Hotspot.Navigate tells a hotspot to navigate to a specified URL (as mentioned in the NavigateURL property).
  • Hotspots may also have a PostBackValue property which would be visible in ImageMapEventArgs of the Click/Command event when the Page is posted back.
  • The SelectionMode property of the Calendar control determines whether the user will be able to select a single date, a whole week, a whole month or none.
  • Calendar control contains a DayRender event that is fired wherever a single day is rendered within the control. We may use DayRenderEventArgs in this event to add various controls to the Cell.Controls collection of this argument.
  • Tilde operator (~) represents application root directory.
  • SaveAs( ) method of FileUpload control requires an absolute path to save a file. For that we use Server.MapPath( ) to specify the directory. Along with it we may use FileName property of the FileUpload control.
  • Panel control renders a DIV element in HTML.
  • A MiltiView control consists of a number of nested View controls. Each View represents a mutually exclusive viewable group of controls. i.e. Only one View is visiable at any time.
  • We may use ActiveViewIndex property or SetActiveView( ) method to change views through code. Setting any of these to -1 would display no Views.
  • Wizard control contains a WizardSteps collection which contains members of type WizardStepBase which in turn inherits from View class.
  • The Xml Control allows to display an XML Document by applying XSL Transforms to it. DocumentSource property is used to specify path to the XML file and TransformSource property is used to specify the XSLT file.

No comments:

Post a Comment