我在命令列内带有自定义按钮的用户控件的ascx页中构建了一个gridview,然后尝试在CustomButtonClick
中管理ClideSideEvents
,如下所示:
(ASCX)
<dx:GridViewCommandColumnCustomButton ID="ASPxCustomCommandButton1"/>
<ClientSideEvents CustomButtonClick="OnCustomButtonClick" />
(JAVASCRIPT)
function OnCustomButtonClick(s, e) {
if (e.buttonID == 'ASPxCustomCommandButton1') {
e.processOnServer = false;
PopupControlUpload.Show();
PopupControlUpload.PerformCallback(e.visibleIndex);
(VB)
Private Sub ASPxGridView1_CustomButtonCallback(sender As Object, e As ASPxGridViewCustomButtonCallbackEventArgs) Handles ASPxGridView1.CustomButtonCallback
Select Case e.ButtonID
Case "ASPxCustomCommandButton1"
//do something"
End Select
我无法在javascript中获取按钮的ID,因此我也无法进入vb回调。我该如何在用户控件中做到这一点?似乎未定义“ e”,因此他无法从中获取buttonID。在正常的网页上,它可以工作,但是在用户控件中,该问题给了我。