protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Response.Cache.SetNoStore();    // Don't cache this page!

            // If someone wanted to go to the Incident_Report page directly
            // (read: didn't go through the Incident_List page first)....
            if (Request.UrlReferrer == null)
            {
                Response.Redirect("CustomError.aspx");
            }
            // If someone wanted to go to the Incident_Report page directly when they are initially not logged in.
            else if (Request.UrlReferrer.LocalPath == "/Website/Login.aspx")
            {
                Response.Redirect("Admin_Home.aspx");
            }

            // If someone wanted to go back to the Incident_Report page using the back button after they
            // have left it, they cannot view the Incident Report they were using.
            if (Profile.IncidentReportID == "" && Profile.DropZoneID == "")
            {
                Response.Redirect("CustomError.aspx");
            }

            // Else they can proceed. ^_^

            Director myDirector = new Director();

            irpb = myDirector.GetBuilder(this, Profile.DropZoneID, Profile.IncidentReportID, Profile.Role);
            if (irpb == null)
            {
                Page.Response.Redirect("CustomError.aspx");
                Profile.IncidentReportID = "";
                Profile.DropZoneID = "";
                Profile.Role = "";
            }
            if (Profile.Role != "Browser")
            {
                JumpTypeDropDownList_SelectedIndexChanged(sender, e);
                JumperCertificateDropDownList_SelectedIndexChanged(sender, e);
            }

            // Make these textboxes have this javascript attribute so user can't focus on them:
            IncidentDateTextbox.Attributes.Add("onfocus", "this.blur()");
            PrevJumpTextBox.Attributes.Add("onfocus", "this.blur()");

            // Make these linkbuttons have this javascript attribute so the user can see a pop-up window when they are clicked.
            Injury_Type_ListLinkButton.Attributes.Add("onclick", "window.open('Pop_Up.aspx?id=injury','popup','width=500,height=500,scrollbars=yes,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false");
            Incident_Type_ListLinkButton.Attributes.Add("onclick", "window.open('Pop_Up.aspx?id=incident','popup','width=500,height=500,scrollbars=yes,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false");

            // Set the text of the PrevJumpCheckBox
            PrevJumpCheckBox.Text = ConfigurationManager.AppSettings.Get("NoPreviousJumpDateValue");

            #region Validators Properties
            RangeValidator_IncidentDateTextbox.Type = ValidationDataType.Date;
            RangeValidator_IncidentDateTextbox.MaximumValue = DateTime.Now.ToString("dd/MM/yyyy");
            RangeValidator_IncidentDateTextbox.MinimumValue = "01/01/1960"; // Before APF was made.

            RangeValidator_PrevJumpTextBox.Type = ValidationDataType.Date;
            RangeValidator_PrevJumpTextBox.MaximumValue = DateTime.Now.ToString("dd/MM/yyyy");
            RangeValidator_PrevJumpTextBox.MinimumValue = "01/01/1960"; // Before APF was made.

            #endregion
        }
    }