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();
}
}
0 comments:
Post a Comment