Session 7: ASP.NET Scripting and Control Structures - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Session 7: ASP.NET Scripting and Control Structures

Description:

onClick (Click) Text Box. onTextChanged (TextChanged) Check Box (or Radio Button) ... Numeric manipulation follows rules of basic math ... – PowerPoint PPT presentation

Number of Views:80
Avg rating:3.0/5.0
Slides: 11
Provided by: Micro253
Category:

less

Transcript and Presenter's Notes

Title: Session 7: ASP.NET Scripting and Control Structures


1
Session 7ASP.NET Scripting and Control
Structures
2
Event Handling with Common Web Server Controls
3
Defining Variables
  • Strongly typed
  • Numeric manipulation follows rules of basic math
  • String manipulation has various functions,
    including
  • Concatenation
  • SubString
  • ToUpper, ToLower

4
Common Data Types
  • Integer
  • Decimal
  • String
  • Boolean
  • Date
  • Object

5
Date Manipulation
  • ASP.NET has extensive date and calendar functions
  • Date
  • Now, Day, Week, Month, Year
  • AddDays, AddWeeks, AddMonths, AddYears
  • ToShortTimeString, ToLongDateString
  • Calendar
  • FirstDayofWeek, SelectedDate, SelectedDates
  • SelectionMode, TodaysDate

6
Conditional Logic (1)
  • IF ... THEN ELSE
  • IF empSal gt 100000 THEN
  • greetLabel.Text Suggested United Way donation
    is 4 of your salary"
  • ELSE
  • greetLabel.Text Suggested United Way donation
    is 2 of your salary"
  • END IF

7
Conditional Logic (2)
  • SELECT CASE
  • SELECT CASE intMonth
  • CASE 1
  • monthLabel.Text "Welcome to January"
  • CASE 2
  • monthLabel.Text "Welcome to February"
  • CASE 3
  • monthLabel.Text "Welcome to March"
  • END SELECT

8
Looping Logic (1)
  • DO WHILE LOOP
  • DO WHILE intDay lt 31
  • cheerLabel.Text "Go Sooners! ltHRgt"
  • intDay intDay 1
  • LOOP

9
Looping Logic (2)
  • DO UNTIL LOOP
  • DO UNTIL intDay gt 31
  • cheerLabel.Text "Go Sooner! ltHRgt"
  • intDay intDay 1
  • LOOP

10
Looping Logic (3)
  • FOR ... NEXT LOOP
  • FOR intCounter 1 to 10
  • cheerLabel.Text intCounter " . Go Sooners!
    ltHRgt"
  • NEXT
Write a Comment
User Comments (0)
About PowerShow.com