示例#1
0
        void BindData1()
        {
            ClassGradCountry gn = new ClassGradCountry();
            DataTable        dt = gn.GetGradCountrySearch(txtSearchGradCountry2.Text, txtSearchGradCountryShort.Text, txtSearchGradCountryLong.Text);

            GridView1.DataSource = dt;
            GridView1.DataBind();
            SetViewState(dt);
        }
示例#2
0
        protected void btnSearchGradCountry_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtSearchGradCountry2.Text) && string.IsNullOrEmpty(txtSearchGradCountryShort.Text) && string.IsNullOrEmpty(txtSearchGradCountryLong.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณากรอก คำค้นหา')", true);

                return;
            }
            else
            {
                ClassGradCountry cg = new ClassGradCountry();
                DataTable        dt = cg.GetGradCountrySearch(txtSearchGradCountry2.Text, txtSearchGradCountryShort.Text, txtSearchGradCountryLong.Text);
                GridView1.DataSource = dt;
                GridView1.DataBind();
                SetViewState(dt);
            }
        }