protected void gv1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
ModalPopupExtender1.Show();
tb.Text = gv1.Rows[e.NewSelectedIndex].Cells[2].Text;
tb1.Text = gv1.Rows[e.NewSelectedIndex].Cells[3].Text;
IEnumerable<datarow> m = (from x in BAL.INSTANCE.disempdetails().AsEnumerable() where x.EID == Convert.ToInt32(gv1.Rows[e.NewSelectedIndex].Cells[2].Text) select new { x.DID, x.DNAME });</datarow>
DataTable dt1 = new DataTable();
dt1.Columns.Add("DID", typeof(string));
dt1.Columns.Add("DNAME", typeof(string));
m.CopyToDataTable(dt1, System.Data.LoadOption.PreserveChanges);
gv.DataSource = m;
gv.DataBind();
ViewState["i"] = 1;
tb1.Focus();
}