1 of 10

Chapter 3

2 of 10

Web Server Controls

    • Label
      • Use to display text on screen
      • Also can be used as a hot key
      • Places <span> elements around the text
      • Style/css supported
    • Literal
      • Works like a Label
      • Provides ‘Mode’ property
      • Unable to apply style/css

3 of 10

Web Server Controls (Cont..)

    • TextBox
      • Properties
        • TextMode TextMode="Password"
        • AutoPostBack (if true, form will be posted on server after losing the focus from control{textbox})
      • Focus() method TextBox1.Focus();
    • Button
      • Click Event
      • Command Event
        • Command Name
        • Command Arguments
      • Client Side event
      • PostBackUrl
        • Cross-page posting

4 of 10

Web Server Controls (Cont..)

    • LinkButton
      • Similar to Button
    • ImageButton
      • Properties
        • ImageUrl<asp:ImageButton ID="ImageButton1" runat="server“ OnClick="ImageButton1_Click" ImageUrl="MyButton.jpg"/>
        • AlternateText
    • HyperLink
      • Server side anchor tag

5 of 10

Web Server Controls (Cont..)

    • DropDownList
      • Properties
        • DataTextField
        • DataValueField
        • AutoPostBack
      • Insert items in collection
    • ListBox
      • Same as DropDownList
      • Show more items on user screen
      • Allow multi selection

​

​

6 of 10

Web Server Controls (Cont..)

    • CheckBox
      • Properties
        • Checked
        • AutoPostBack
        • TextAlign
    • CheckBoxList
      • Contains a list of checkboxes
      • Properties
        • DataTextField
        • DataValueField
        • RepeatColumns
        • RepeatDirection

​

​

​

7 of 10

Web Server Controls (Cont..)

    • RadioButton
      • Properties
        • Checked
        • GroupName
        • AutoPostBack
    • RadioButtonList
      • Contains a list of radio selection
      • Properties
        • DataTextField
        • DataValueField

​

8 of 10

Web Server Controls (Cont..)

    • Image
      • Properties
        • ImageUrl
        • ImageAlign
    • Table
      • Dynamic table
      • Caption attribute
    • Calendar
      • SelectionMode

9 of 10

Web Server Controls (Cont..)

    • Panel
      • Rapper for other controls
      • Apply an attribute then it applies to all inner controls (font-bold=‘true’)
      • Apply ScrollBars
      • Horizontal Align (Justify, Center, Left, Right)
    • BulletedList
      • Bullet Style (circle, Disc, Numbered, etc)
      • DisplayMode (LinkButton, Hyperlink, Text)
      • DataValueField, DataTextField

10 of 10

Web Server Controls (Cont..)

    • HiddenField
      • Use to store value
      • Viewable in source code
    • FileUpload
      • Max Request Length (default value = 4096 byte)
      • Allow Multiple Files