在gridview Linkbutton有不同的id和做回发事件目标,它应该是相同的
本文关键字:目标 事件 Linkbutton gridview id | 更新日期: 2023-09-27 17:52:38
href="javascript:__doPostBack('grid1$ctl02$lkbDelete','')"
id="grid1_lkbDelete_0"
完整链接为:
<a onclick="javascript:return PopupDialouge('<b>Are you sure you want to delete this Record?</b>'nbecause all Process related comments for this record'nwill be deleted.','Confirmation','Delete','Cancel',this,'ui-icon-alert');" id="grid1_lkbDelete_0" name="lkbDel" href="javascript:__doPostBack('grid1$ctl02$lkbDelete','')">Delete</a>
实际上我想通过捕获eventargument
来捕获custom postback
,但这里我只能获得事件目标,它应该与事件目标相同,但它不同,所以我不能导致manual postback
我自己做的,我把gridview客户端模式从静态改为自动,然后我把下划线_从linkbtn id替换为美元$,然后它工作了。
var ctlid=this.id.replace(/_/g,'$');
function postback(){
__dopostback(ctlid,'');
}