从jquery方法调用c#事件 [英] Call c# event from jquery method

查看:85
本文介绍了从jquery方法调用c#事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




如何从我的Jquery方法调用事件?

Hi
How can I call an event from my Jquery method?

推荐答案

这一切都没有意义。首先,没有召集事件这样的事情。到目前为止,可以调用事件实例,这是不一样的。通过调用调用添加到事件实例的调用列表中的所有事件处理程序。此外,除了声明此事件的类型的实例之外,没有任何东西可以调用.NET事件。即使是派生类的实例也无法调用它。这是平台的重要防呆功能,而非限制。因此,忘记从jQuery调用,它甚至可以在客户端的不同机器上运行。你甚至不能谈论在服务器上调用任何方法,甚至不调用事件。通过向服务器端发送一些HTTP请求来使用服务器端。



所以,这个问题毫无意义。为了进一步发展,您至少需要解释您的最终目标,您可以获得一些有用的建议。到目前为止,我能给你的唯一有用的建议是:了解.NET(CLR)的工作原理以及Web的工作原理;现在,你对两者都有非常模糊的理解。不要太担心:付出一些体面的努力并学习它。



-SA
It all makes no sense. First of all, there is no such thing as "call an event". An event instance can be invoked, which is not the same, by far. All event handlers added to the invocation list of event instance are called by invocation. Besides, nothing can invoke a .NET event except the instance of the type declaring this event. Even an instance of derived class cannot invoke it. This is important fool-proof feature of the platform, not limitation. So, forget "calling" from jQuery, which even works on different machine, on the client side. You cannot even talk of calling any method on the server, not even event invocation. The server side is used by sending some HTTP requests to the server side.

So, the question makes no sense. To move further, you need at least explain your ultimate goals, the you can get a change for some useful advice. So far, the only useful advice I can give you is: learn how .NET (CLR) works and how Web works; right now, you have very vague understanding of both. Not too worry: put some decent effort and learn it.

—SA


这篇关于从jquery方法调用c#事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆