Add the Admin Home Page

Purpose:

This process will create a Web form in your Web Forms project which will execute the tests you have created.

Starting Point:

The Region data entry form is complete.

Steps:

  1. Add a new Web form called AdminHomePage to your Web forms project.
  2. Drag a button from the Web Forms tab of the Toolbox onto the center of the Designer window.
  3. Press F4 to display its properties.
  4. Change the ID property to 'regionDataEntryFormButton'.
  5. Change the Text property to 'Open Region'.
  6. Set the AccessKey property to 'r'.
  7. Add a DropDownList above the button, and change its id to regionDropDownList.
  8. Double-click anywhere on the empty part of the form to open the Page_Load function.
  9. Add code to initialize the dropdownlist using the public static method of the Region business object class when the form first loads.
  10. Return to the form's designer window and double-click on the button to create and open the button's click handler.
  11. Add a line to set the session RegionID variable to the current value of the dropdownlist.
  12. Add a line to redirect the browser to the Region data entry form.
  13. The button code should look something like this:

    private void regionDataEntryFormButton_Click(object sender, System.EventArgs e)
    {
        Session["RegionID"] = this.regionDropDownList.SelectedValue;
        Response.Redirect("RegionDataEntry.aspx");
    }
     
  14. Compile, Save, and Test.  Debug if necessary.  (Testing should include the Region data entry form.)

Rationale

This puts the last method of the data entry class to work, and allows the data entry form to be tested.  This form will also serve as a launch pad for other forms as they are added to the project.

Discussion:

This is a simple chore, again because all of the work is already done by our business object.  The hardest job for you here will probably be tracking down subtle errors in the data entry form.

Previous Step: Create the Region Data Entry Form

Next Step: Create the Web Services Project