gridview中的超链接字段onclick事件 [英] hyperlinkfield onclick event in gridview
本文介绍了gridview中的超链接字段onclick事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在gridview中的超链接字段onclick事件上编写代码.
我在网格视图中有超链接字段.请告诉我要在上面写代码.
i want to write code on hyperlinkfield onclick event in gridview.
I have hyperlinkfield in grid view. plz tell me hoe to write code on that.
推荐答案
嗨....
请参考
在ASP.NET中的GridView中创建HyperLinkField的实用指南
Hi....
Refer this
Practical Guide for Creating HyperLinkField in GridView in ASP.NET
<asp:linkbutton id="lnb" runat="server" text="Edit" commandname="Edit" commandargumnet="<%Eval(" xmlns:asp="#unknown">
当您单击该链接时,将触发行命令事件
when u click on that link your Row Command Event will fire
do your functionality there.
<asp:TemplateField HeaderText="No.">
<ItemTemplate>
<asp:HyperLink ID="lbtnBOLNo" runat="server" Text='<%# Eval("No") %>' OnClick="lbtnBOLNo_Click"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
protected void lbtnBOLNo_Click(object sender, EventArgs e)
{
templbtn = (LinkButton)sender;
ScriptManager.RegisterStartupScript(Page, this.GetType(), "alert", "window.location='Default2.aspx'; ", true);
}
这篇关于gridview中的超链接字段onclick事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文