7

我遇到了将参数传递给客户端事件的问题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]。是同样的错误

4

2 回答 2

22

将双引号更改为单引号

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

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

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

OnClientClicking='<%# "confirmCallBackFn("+ Eval("MeetingID") + ");" %>'
于 2013-07-08T11:43:19.887 回答
0

尝试OnClientClicking='<%# Eval("MeetingID", "confirmCallBackFn({0})") %>'

于 2016-11-09T04:44:26.970 回答