Asp.net
如何使用客戶端函式“OnClientClicking”傳遞綁定或評估參數
我遇到了將參數傳遞給客戶端事件的問題
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") + ");" %>'
嘗試
OnClientClicking='<%# Eval("MeetingID", "confirmCallBackFn({0})") %>'