Click here to Skip to main content
16,004,505 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
How can I call an event from my Jquery method?
Posted
Comments
Sergey Alexandrovich Kryukov 5-Feb-14 1:15am    
Why? Makes no sense anyway...
—SA
Sampath Lokuge 5-Feb-14 1:18am    
Can we have more info about your task ?
Anele Ngqandu 5-Feb-14 1:25am    
Have a bunch of code in the event and in jquery there is a method that validates values that are used by the event. now either i call the jquery event on c# or the other way round. Is it possible?

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900