ASP.NET Presentation #5

Embed Size (px)

Citation preview

  • 8/14/2019 ASP.NET Presentation #5

    1/14

    STANDARD CONTROLS

  • 8/14/2019 ASP.NET Presentation #5

    2/14

    Session objectives

    ASP.NET Controls

    Whats in the Toolbox

    Web forms vs HTML Controls Standard Controls in ASP.NET

    Properties & Event of Standard

    Control

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/
  • 8/14/2019 ASP.NET Presentation #5

    3/14

    ASP.NET Controls

    WebForm Controls

    HTML Controls

    Web User Controls

    Custom Controls

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/
  • 8/14/2019 ASP.NET Presentation #5

    4/14

    Whats in the Toolbox?

    WebForm Controls

    -TextBox, Label, Hyperlink, Etc

    -DropDownList, DataGrid, DataList, Etc

    HTML Controls (Client or Server)

    ADO.NET Design Controls

    System Components

    Validation Controls

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/
  • 8/14/2019 ASP.NET Presentation #5

    5/14

    WebForm Vs HTML Controls

    Both have the following benefits

    An object model that you can program against on the server

    A set of events for which you can write sever side event handlers

    The ability to handle events in client script Interaction with validation controls so you can easily verify that a

    user has entered appropriate information into a control

    Data binding to one or more properties of the control

    Support for HTML 4.0 styles if the Web Forms page is displayed in

    a browser that supports cascading style sheets Pass-through ofcustom attributes

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/
  • 8/14/2019 ASP.NET Presentation #5

    6/14

    STANDARD CONTROLS IN ASP.NET

    Button

    CheckBox

    CheckBoxList DropDownList

    HyperLink

    Image

    ImageButton

    ImageMap

    Label

    LinkButton

    ListBox

    TextBox

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/
  • 8/14/2019 ASP.NET Presentation #5

    7/14

    Properties & Event of Standard Control

    Button - OnClick event to determine theparticular Button that was clicked

    CheckBox

    - CheckBox server control acceptsBoolean (true or false) input. Whenselected, its Checked property is true-CheckedChanged is the event

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/
  • 8/14/2019 ASP.NET Presentation #5

    8/14

    CheckBoxList-CheckBoxList has an Items collectionwith members that correspond toeach item in the list. To determinewhich items are selected, test theSelected property of each item

    - SelectedIndexChanged is the Event

    Properties & Event of Standard Control

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/
  • 8/14/2019 ASP.NET Presentation #5

    9/14

    DropDownList-The value of the currently Selected item isexposed through the SelectedValue

    property of DropDownList-SelectedIndexChanged is the Event

    ImageButton- Like the Button control, ImageButton is

    used to post back to the server withImageUrl Property

    Properties & Event of Standard Control

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/
  • 8/14/2019 ASP.NET Presentation #5

    10/14

    ImageMap-Click event also supplies the x/ycoordinates of where the user clicked

    the image. This provides a means torespond differently depending onwhat part of the image is clicked.

    TextBox-TextBox control enables the user toenter text in Text property

    Properties & Event of Standard Control

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/
  • 8/14/2019 ASP.NET Presentation #5

    11/14

    Properties & Event of Standard Control

    ListBox-The ListBox control provides asingle-selection or multiple-selectionlist. To enable multiple selection, setthe SelectionMode property toMultiple

    -SelectedIndexChanged is the Event

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/
  • 8/14/2019 ASP.NET Presentation #5

    12/14

    Properties & Event of Standard Control

    HyperLink-The HyperLink control supports databinding to its Text and NavigateUrlproperties

    Label-Displays text in a set location on the

    page using Text property

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/
  • 8/14/2019 ASP.NET Presentation #5

    13/14

    LinkButton-Like the Button control, LinkButton isused to post a Web forms page back

    to the server Image

    -The Image control displays the image

    defined by its ImageUrl property.

    Properties & Event of Standard Control

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/
  • 8/14/2019 ASP.NET Presentation #5

    14/14

    Session Summary

    ASP.NET Controls

    Whats in the Toolbox

    Web forms vs HTML Controls Standard Controls in ASP.NET

    Properties & Event of Standard

    Control

    http://www.guyfromchennai.com Kumar S

    http://www.guyfromchennai.com/http://www.guyfromchennai.com/http://www.guyfromchennai.com/