Gautam Buddha Temple Varanasi,Varanasi - Buddhist Pilgrimage

Friday, September 10, 2010

Onclick Gridview Select button fill all the data to textbox.

 Onclick Gridview Select button fill all the data to textbox.  
 All the textbox out of gridview.  
 protected void ImgSelect_Click(object sender, ImageClickEventArgs e)  
 {  
      ImageButton aspSender = sender as ImageButton;  
      Label Id = aspSender.FindControl("lblContId") as Label;  
      hdnId.Value = Id.Text;  
      DataSet dsContact = new DataSet();  
      dsContact = SqlHelper.ExecuteDataset(connectionString, "usp_GetContact", Convert.ToInt32(Id.Text.Trim()), EmpId, "S");  
      if (dsContact.Tables[0].Rows.Count != 0)  
      {  
           txtName.Text = dsContact.Tables[0].Rows[0]["Name"].ToString();  
           ddlRelation.SelectedValue = dsContact.Tables[0].Rows[0]["RelId"].ToString();   
           txtAddress.Text = dsContact.Tables[0].Rows[0]["Address"].ToString();  
      }  
 }  

No comments:

Post a Comment