Ejemplo n.º 1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(txtActYear.Text) || String.IsNullOrEmpty(txtCurriculum.Text) || String.IsNullOrEmpty(txtDescription.Text) || String.IsNullOrEmpty(txtState.Text))
     {
         if (lblsignWarning.Visible == true)
         {
             lblsignWarning.Visible = false;
         }
         else
         {
             lblsignWarning.Visible = true;
         }
     }
     else
     {
         Page.MaintainScrollPositionOnPostBack = true;
         SqlDataSource1.InsertParameters["TitleOfCurriculum"].DefaultValue = txtCurriculum.Text;
         SqlDataSource1.InsertParameters["ActivatedYear"].DefaultValue     = txtActYear.Text;
         SqlDataSource1.InsertParameters["Description"].DefaultValue       = txtDescription.Text;
         SqlDataSource1.InsertParameters["State"].DefaultValue             = txtState.Text;
         SqlDataSource1.Insert();
         GridView1S.DataSourceID = "SqlDataSource1";
         GridView1S.DataBind();
         clearItems();
         lblsignWarning.Visible = false;
     }
 }
Ejemplo n.º 2
0
 protected void txtSearch_TextChanged(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(txtSearch.Text))
     {
         if (GridView1S.DataSourceID.Equals("SqlDataSource1"))
         {
             GridView1S.DataSourceID = "SqlDataSource2";
             GridView1S.DataBind();
         }
     }
     else
     {
         GridView1S.DataSourceID = "SqlDataSource1";
         GridView1S.DataBind();
     }
 }