加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 如何使用客户端函数“OnClientClicking”传递bind或e

发布时间:2020-12-16 03:44:08 所属栏目:asp.Net 来源:网络整理
导读:我遇到了将参数传递给客户端事件OnClientClicking的问题. 我试图使用String.Format()函数,但它不起作用. 您是否有解决方法来发送与OnClientClicking链接的参数? 代码asp: telerik:RadButton ID="bnt_meetingDelete" runat="server" OnClientClicking="%# s
我遇到了将参数传递给客户端事件OnClientClicking的问题.

我试图使用String.Format()函数,但它不起作用.

您是否有解决方法来发送与OnClientClicking链接的参数?

代码asp:

<telerik:RadButton ID="bnt_meetingDelete" runat="server" OnClientClicking="<%# string.Format("confirmCallBackFn('{0}');",Eval("MeetingID")) %>" Image-ImageUrl="~/image/icone/delete-icon.png" Image-IsBackgroundImage="true" Width="21" Height="21" telerik:RadButton>

错误IIS:

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: The server tag is not well formed.

我试过控制器[asp:ImageButton].并且是同样的错误

解决方法

将双引号更改为单引号

OnClientClicking="<%#string.Format("confirmCallBackFn('{0}');",Eval("MeetingID")) %>"

OnClientClicking='<%#string.Format("confirmCallBackFn('{0}');",Eval("MeetingID")) %>'

或者删除你的string.Format并像这样使用

OnClientClicking='<%# "confirmCallBackFn("+ Eval("MeetingID") + ");" %>'

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读