Asp.net 如何以编程方式分配事件处理程序

Asp.net 如何以编程方式分配事件处理程序,asp.net,devexpress,aspxgridview,Asp.net,Devexpress,Aspxgridview,我正在使用DevExpress AspxGridView,并试图在页面加载中以编程方式分配OnCustomCallBack。但它不起作用。这是我的密码 aspxGrid1.attributes.add("OnCustomCallback","MyServerSideFunctionName") 你是说这个吗 aspxGrid1.CustomCallback += new AspxGridViewCustomCallbackHandler(MyServerSideFunctionName);

我正在使用DevExpress AspxGridView,并试图在页面加载中以编程方式分配OnCustomCallBack。但它不起作用。这是我的密码

aspxGrid1.attributes.add("OnCustomCallback","MyServerSideFunctionName")
你是说这个吗

aspxGrid1.CustomCallback += new AspxGridViewCustomCallbackHandler(MyServerSideFunctionName);
(我没有DevExpress控件,因此您必须调整代理名称。)


还是要使用反射来执行此操作?

在VB.Net中,您将以以下方式附加处理程序:

AddEventHandler aspxGrid1.CustomCallBack, addressof MyServerSideFunction