コード例 #1
0
        void BindData1()
        {
            ClassFaculty f  = new ClassFaculty();
            DataTable    dt = f.GetFacultySearch(txtSearchFacultyID.Text, txtSearchFacultyName.Text, txtSearchCampusID.Text);

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

                return;
            }
            else
            {
                ClassFaculty f  = new ClassFaculty();
                DataTable    dt = f.GetFacultySearch(txtSearchFacultyID.Text, txtSearchFacultyName.Text, txtSearchCampusID.Text);
                GridView1.DataSource = dt;
                GridView1.DataBind();
                SetViewState(dt);
            }
        }