Esempio n. 1
0
        protected void btnApply_Click(object sender, EventArgs e)
        {
            //create an instance of the address collection
            ClsAddressCollection Addresses = new ClsAddressCollection();

            Addresses.ReportByPostCode(txtFilter.Text);
            lstAddressList.DataSource = Addresses.AddressList;
            //set the name of the primary key
            lstAddressList.DataValueField = "AddressNo";
            //set the name of the field to display
            lstAddressList.DataTextField = "PostCode";
            //bind the data to the list
            lstAddressList.DataBind();
        }
Esempio n. 2
0
        protected void btnClear_Click(object sender, EventArgs e)
        {
            //create an instance of the address collection
            ClsAddressCollection Addresses = new ClsAddressCollection();

            Addresses.ReportByPostCode("");
            //clear any existing filter to tidy up the interface
            txtFilter.Text            = "";
            lstAddressList.DataSource = Addresses.AddressList;
            //set the name of the primary key
            lstAddressList.DataValueField = "AddressNo";
            //set the name of the field to display
            lstAddressList.DataTextField = "PostCode";
            //bind the data to the list
            lstAddressList.DataBind();
        }