链接栏 [英] Link Column
本文介绍了链接栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人
我想创建一个网格以显示员工编号和姓名.
但是我想单击员工编号字段以在标签或文本框中显示姓名.
dear all
I want to create a grid to display the employee number and name.
but I want to click the employee number field to display the name in label or text box.
can you help me please?
推荐答案
<asp:gridview id=""GridView1"" runat=""server"" allowpaging=""True"" autogeneratecolumns=""false"" onrowcommand=""GridView1_RowCommand"" xmlns:asp="#unknown">
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="edititem"> <%# Eval("Employeeid") %>''</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</asp:gridview>
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "edititem")
{
// code to display name.
}
}
这篇关于链接栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文