本文介绍了如何通过单击gridview中的链接按钮将值从db获取到弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
in gridview i have link button "lbnOrderId"
when im clicking "lbnOrderId" i want to display(@orderId,@UserName,@PhoneNo)
in popup window.
推荐答案
protected void fect_taskid(object sender, GridViewCommandEventArgs e)
{
try
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = GridView1.Rows[index];
lblassinmentno.Text = row.Cells[1].Text;
lblassinedon.Text = row.Cells[9].Text;
lblcontactno.Text = row.Cells[8].Text;
lbldeptt.Text = row.Cells[4].Text;
lblempcode.Text = row.Cells[3].Text;
lblmailid.Text = row.Cells[6].Text;
lblName.Text = row.Cells[2].Text;
designation.Text = row.Cells[5].Text;
GridView3.DataBind();
this.modal11.Show();
}
catch(Exception ex)
{
}
void Getdata()
{
SqlConnection con = new SqlConnection(@"Data Source=.;Initial Catalog=test;Integrated Security=True");
string statement = "select item_code, Item_name, brand, size, section, price, Material, Qty, tax, tt from Items ";
SqlDataAdapter da = new SqlDataAdapter(statement, con);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}
最好的问候
米特瓦里(M.Mitwalli)
Best Regards
M.Mitwalli
这篇关于如何通过单击gridview中的链接按钮将值从db获取到弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!