Пример #1
0
        void BindData1()
        {
            ClassProvince p  = new ClassProvince();
            DataTable     dt = p.GetProvinceSearch(txtSearchProvinceID.Text, txtSearchProvinceTH.Text, txtSearchProvinceEN.Text);

            GridView1.DataSource = dt;
            GridView1.DataBind();
            SetViewState(dt);
        }
Пример #2
0
        protected void btnSearchProvince_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtSearchProvinceID.Text) && string.IsNullOrEmpty(txtSearchProvinceTH.Text) && string.IsNullOrEmpty(txtSearchProvinceEN.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณากรอก คำค้นหา')", true);

                return;
            }
            else
            {
                ClassProvince p  = new ClassProvince();
                DataTable     dt = p.GetProvinceSearch(txtSearchProvinceID.Text, txtSearchProvinceTH.Text, txtSearchProvinceEN.Text);
                GridView1.DataSource = dt;
                GridView1.DataBind();
                SetViewState(dt);
            }
        }