问题描述
LinkButton lnkBtn =(LinkButton)e.CommandSource; //按钮
GridViewRow myRow =(GridViewRow)lnkBtn.Parent.Parent; //行
GridView myGrid =(GridView)发送者; // gridview
字符串ID = myGrid.DataKeys [myRow.RowIndex] .Value.ToString();
这里我得到了id作为www.google.com,现在我想将它分配给链接或超链接buttom,以便它必须打开该链接
LinkButton lnkBtn = (LinkButton)e.CommandSource; // the button
GridViewRow myRow = (GridViewRow)lnkBtn.Parent.Parent; // the row
GridView myGrid = (GridView)sender; // the gridview
string ID = myGrid.DataKeys[myRow.RowIndex].Value.ToString();
here i got id as www.google.com,, now i want to assign it to link or hyperlink buttom so that it must open that link
推荐答案
这篇关于如何添加超链接到网格和我希望从Sqldatabase添加URL的超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!