本文介绍了如何访问gridview EmptyDataTemplate控制客户端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I have to access the label from gridview emptydatatemplate using javascript or jquery. when button onclientclick event occurs outside the gridview.
Example :
<script type="text/javascript">
//button1 OnClientClick function call
function fun_AddnlFeeChange()
{
//When this client function call i need to change the EmptyDataTemplate additional fees label value
//I need to bind some calculation value in that additional fee label
return false;
}
</script>
<table>
<tr>
<td colspan="10" align="center">
<asp:GridView ID="gv_CreateNewPO" runat="server" AutoGenerateColumns="False" GridLines="None"
ShowFooter="True" Width="100%">
<EmptyDataTemplate>
<table border="0" cellpadding="0" cellspacing="0" align="left" width="100%">
<tr>
<th align="left" class="tableheadernew">
Line #
</th>
<th align="left" class="tableheadernew">
Price Ref.#
</th>
<th align="left" class="tableheadernew">
Addnl. Fees
</th>
<th align="left" class="tableheadernew">
Cert/Srvc
</th>
<th align="left" class="tableheadernew">
Note
</th>
<th align="left" class="tableheadernew">
</th>
<tr>
<td>
<asp:Label ID="lbl_CNPOLineNo" runat="server" Text="1">
</asp:Label>
</td>
<td class="Rowstyle">
<asp:TextBox ID="txt_CNPOPriceRef" runat="server" ></asp:TextBox>
</td>
<td>
<asp:Label runat="server" ID="lbl_AddnlFees"></asp:Label>
</td>
<td class="Rowstyle">
<asp:LinkButton ID="lnk_CertSrvc" runat="server">Enter</asp:LinkButton>
</td>
<td class="Rowstyle">
<asp:LinkButton ID="lnk_Note" runat="server">Enter</asp:LinkButton>
</td>
<td class="Rowstyle">
<asp:LinkButton ID="lnk_Save" runat="server">Save</asp:LinkButton>
</td>
</tr>
<tr>
<td class="tablefooterfinal" colspan="17">
</td>
</tr>
</tr>
</table>
</EmptyDataTemplate>
</asp:GridView>
</td>
<tr>
<tr>
<td align="center">
<asp:Button ID="Button1" runat="server" Text="Process" OnClientClick="return fun_AddnlFeeChange();" />
</td>
</tr>
</table>
推荐答案
这篇关于如何访问gridview EmptyDataTemplate控制客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!