Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bool pollutantInRequest = LinkSearchBuilder.HasPollutantFilter(Request) || LinkSearchBuilder.HasMediumFilter(Request);

            bool collapse = !pollutantInRequest;
            this.cpePollutant.Collapsed   = collapse;
            this.cpePollutant.ClientState = collapse.ToString();

            togglePanel(collapse);
        }
        else
        {
            //If previous search was with only Waste Water enabled we must disable Accidental
            CheckBox chkAir   = (CheckBox)CommonFunctions.ControlTool.FindControlR(this, "chkAir");
            CheckBox chkWater = (CheckBox)CommonFunctions.ControlTool.FindControlR(this, "chkWater");
            CheckBox chkSoil  = (CheckBox)CommonFunctions.ControlTool.FindControlR(this, "chkSoil");
            if (!chkAir.Checked && !chkWater.Checked && !chkSoil.Checked)
            {
                CheckBox chkAccidental = (CheckBox)CommonFunctions.ControlTool.FindControlR(this, "chkAccidental");
                chkAccidental.Checked = false;

                // for some reason .Net an't figure out how to make .Net enabled and JS .disabled work together, so we do it this way
                ScriptManager.RegisterStartupScript(chkAccidental, chkAccidental.GetType(), this.UniqueID, "PRTLoadValidation()", true);
            }
        }
    }