To Home Page
IT 130 -- Examples
XHTML and CSS Review
ASP.Net Intro
- Example 4
showtime.aspx
Source Code
Show current time on an .aspx page. The time is obtained from
a function call delimited by <%= and %>.
- Example 5
clickcounter1.htm
Source Code
Count button clicks using a JavaScript event handler.
The examples.css style sheet is used.
- Example 6
clickcounter2.aspx
Source Code
Count button clicks using a C# event handler. The C# code is
located in the .aspx file.
- Example 7
clickcounter3.aspx
Source Code
Count button clicks using a C# event handler. The C# code is
located in the code-behind file file with extension .aspx.cs.
C# Classes and Objects
- Example 8
greeter1.aspx
Source Code
Take a name from a textbox and construct a greeting using that
name, which is displayed in another textbox.
- Example 9
greeter2.aspx
Source Code
Take a name from a textbox and construct a greeting using that
name, which is displayed directly on the document.
- Example 10
datetime.aspx
Source Code
Object the current date from a DateTime object using the Now
property. Show how to use other properties and methods from
this object.
- Example 11
random-numbers.aspx
Source Code
Compute a random double and random integers obtained from
a Random object. Use properties and methods
from this object.
C# Structured Programming
C# Arrays
ASP.Net Web Controls
Form Posting and Validation Controls
- Example 29
submit-form1.aspx
Source Code
Submit ASP.Net form, then post data back to same form. (This is the default in ASP.Net.)
- Example 30
submit-form2.aspx
Source Code
Source Code for verify1.aspx
Submit HTML form, post data to the form verify2.htm. (This is the traditional style for
submitting HTML forms. Use method=get, which passes data in the URL.)
- Example 31
submit-form3.aspx
Source Code
Source Code for verify1.aspx
Submit HTML form, post data to the form verify2.form. (This is the traditional style for
submitting HTML forms. Use method=post, which passes data in the HTTP header.)
- Example 32
submit-form4.aspx
Source Code
Same as Example 29, but use the following ASP.Net validation controls:
RequiredFieldValidator, CompareValidator, RangeValidator, RegularExpressionValidator.
- Example 33
submit-form5.aspx
Source Code
Source Code for verify2.aspx
Same as Example 32, but post to the page verify2.aspx.
- Example 34
regex.aspx
Source Code
Validate expressions, given your own regular expression. Use for
checking practice problems involving regular expressions.
IO to and from Textfiles
The Session and Application Collections
CSS Examples
- Example 51
color-game.aspx
Source Code
Display a random color on the left.
The user tries to match its hex color code on the right.
- Example 52
absolute.htm
Right click and View source to see source code.
Show how to position div layers with absolute positioning.
- Example 53
float.htm
Right click and View source to see source code.
Use the CSS property float to allow text to flow around images.
Database Examples
- Example 54
grocery-display3.aspx
Source Code
Display the on sale items from the groceries.mdb database
database in a DataGrid control. Pick a select
statement for choosing which data to display.
Here is a zip file of the
groceries.mdb database.
- Example 55
grocery-display4.aspx
Source Code
Display the on sale items from the groceries.mdb database
database in a DataGrid control. Pick a select
statement for choosing which data to display.
Here is a zip file of the
groceries.mdb database.
- Example 56
access-datasource.aspx
Source Code
Display the on sale items from the groceries.mdb
database in a DataGrid control. Use an
AccessDatasource object to obtain the data.Here is a zip
file of the groceries.mdb
database.
- Example 57
dataset-direct1.aspx
Source Code
Display the on sale items from the groceries.mdb
directly in a literal control by accessing the
Tables collection of the Dataset Directly.
Here is a zip file of the
groceries.mdb database.
- Example 58
show-xml.aspx
Source Code
Display the xml code for the DataSet object
created from the groceries.mdb database.
- Example 59
dataset-direct2.aspx
Source Code
Display the data in the groceries.mdb database
in textboxes, which are populated from the
DataSet object without using data binding.
Here is a zip file of the
groceries.mdb database.
- Example 60
repeater.aspx
Source Code
Display the on sale items from the groceries.mdb
database using a Repeater control.
Here is a zip file of the
groceries.mdb database.
- Example 61
persons-display.aspx
Source Code
Use an AccessDataSource object to manage the
connection. Display rows from the Persons table where
age interval and gender are specified by the
user. Here is a zip file
file of the persons.mdb database.
- Example 62
insert-data.aspx
Source Code
Populate, display, and clear table data.
Use the ExecuteNonQuery method of the command
object to populate and clear the dataset. Here is the
input text file
persons.txt.
- Example 63
voting-machine3.aspx
Source Code
Record vote totals in a database.
- Example 64
states.aspx
Source Code
Load state names and abbreviations into
a dropdownlist control using databinding.
Here is the States table.
- Example 65
seeds2.aspx
Source Code
In this example, a Repeater control is not used. Controls are entered
using HTML. Each time an order is placed, a row is entered in
the Orders table of the seed-orders.mdb.
Click here to view the
Orders table.
- Example 66
seeds1.aspx
Source Code
In this example, a Repeater control is used to display the information
from a database on a webpage in customized form. Even though HTML
checkboxes are included, they are not functional. ASP.Net controls
cannot be used in the Repeater output. Here is the database table
that is displayed:
SeedCatalog.
Special Topics