本文介绍了如何为updatepanel触发器获取转发器的按钮ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
i在带有更新面板的转发器中有一个按钮。
现在,问题是,触发器controlID无法在转发器中获取按钮ID,
如何获取此按钮ID。
plz建议我,
Hi guys,
i have a button in a repeater with update panel.
now, the problem is, the triggers controlID is not able get button id which in the repeater,
how to get this button id.
plz suggest me,
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table class="table table-bordered table-hover">
<thead class="bg-primary lt">
<tr>
<th style="width: 50px;">
S.No.
</th>
<th>
Name
</th>
<th>
Position
</th>
<th>
Extension
</th>
<th>
Action
</th>
</tr>
</thead><tbody>
</HeaderTemplate>
<itemtemplate>
<tr>
<td><b>
<%# Container.ItemIndex + 1 %></b>
</td>
<td><%# Eval("EmpName") %></td>
<td><%# Eval("Position") %></td>
<td><%# Eval("ExtensionNo") %></td>
<td>
<asp:LinkButton ID="btndel1" CssClass="btn btn-danger" runat="server" CommandName="delete"
CommandArgument='<%# Eval("RecID") %>' ToolTip='Delete'
OnClientClick="return confirm('Are you SURE you want to Delete this Ext?');"
OnClick="btndel_Click">
<span class="fa fa-trash-o"></span></asp:LinkButton>
 
<asp:LinkButton ID="btnedit1" CssClass="btn btn-info" runat="server" ToolTip="Edit"
CommandArgument='<%# Eval("RecID") %>' OnClick="btnedit_Click" >
<i class="fa fa-edit"></i></asp:LinkButton>
</td>
</tr>
</itemtemplate>
<Footertemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btndel1" /> //throwing error id not found
<asp:AsyncPostBackTrigger ControlID="btnedit1" /> // same error
</Triggers>
</asp:UpdatePanel>
谢谢
thanks
推荐答案
这篇关于如何为updatepanel触发器获取转发器的按钮ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!