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:
- Add a new Web form called AdminHomePage to your Web forms
project.
- Drag a button from the Web Forms tab of the Toolbox
onto the center of the Designer window.
- Press F4 to display its properties.
- Change the ID property to 'regionDataEntryFormButton'.
- Change the Text property to 'Open Region'.
- Set the AccessKey property to 'r'.
- Add a DropDownList above the button, and change its id
to regionDropDownList.
- Double-click anywhere on the empty part of the form to
open the Page_Load function.
- Add code to initialize the dropdownlist using the
public static method of the Region business object class when the form first
loads.
- Return to the form's designer window and double-click
on the button to create and open the button's click handler.
- Add a line to set the session RegionID variable to the
current value of the dropdownlist.
- Add a line to redirect the browser to the Region data
entry form.
- 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");
}
- 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