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

发布于 2024-08-16 11:24:15 字数 189 浏览 4 评论 0原文

我正在使用 DevExpress AspxGridView,并尝试在 Page_Load 中以编程方式分配 OnCustomCallBack。但没有成功。这是我的代码,

aspxGrid1.attributes.add("OnCustomCallback","MyServerSideFunctionName")

I'm using DevExpress AspxGridView and I'm trying to assign OnCustomCallBack programatically in the Page_Load. but it didn't work. this is my code,

aspxGrid1.attributes.add("OnCustomCallback","MyServerSideFunctionName")

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

記憶穿過時間隧道 2024-08-23 11:24:15

你是这个意思吗?

aspxGrid1.CustomCallback += new AspxGridViewCustomCallbackHandler(MyServerSideFunctionName);

(我没有 DevExpress 控件,因此您必须调整委托名称。)

或者您想使用 Reflection 来实现吗?

Do you mean this?

aspxGrid1.CustomCallback += new AspxGridViewCustomCallbackHandler(MyServerSideFunctionName);

(I have no DevExpress Controls so you have to adapt the delegates name.)

Or do you want to do it with Reflection?

你在我安 2024-08-23 11:24:15

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

AddEventHandler aspxGrid1.CustomCallBack, addressof MyServerSideFunction

In VB.Net, you would attach a handler in this fashion:

AddEventHandler aspxGrid1.CustomCallBack, addressof MyServerSideFunction
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文