protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { LinqDataSource1.DataBind(); GridView1.DataBind(); } }
private void InitControlValuesForEdit(int lessonId) { train_lesson_basicInfo info = bEdit.select_info(lessonId); Name.Text = info.Name; Name.Enabled = true; Number.Text = info.Number; Number.Enabled = true; Time.Text = info.Time.ToString(); Time.Enabled = true; Description.Text = info.Description; Description.Enabled = true; Type.Value = info.Type; Type.Enabled = true; Type.DataBind(); LinqDataSource1.DataBind(); btnSave.Enabled = true; //btnSubmit.Enabled = false; btnDelete.Enabled = true; }
protected void Button12_Click(object sender, EventArgs e) { if (TextBox1.Text.Length > 1) { LinqDataSource1.Where = "Name.Contains(" + "\"" + TextBox1.Text + "\"" + ")"; } else if (TextBox2.Text.Length > 1) { LinqDataSource1.Where = "Melli_ID=" + "\"" + TextBox2.Text + "\""; } else { LinqDataSource1 = LinqDataSource2; LinqDataSource1.DataBind(); Response.Redirect("MainPage3.aspx"); } // gridvi.DataBind(); //From u In db.vUser Where u.First_Name.Contains(searchText) Select u }
protected void Button1_Click(object sender, EventArgs e) { LinqDataSource1.DataBind(); ListView1.DataBind(); }