Rank: Newbie Groups: Member
Joined: 7/11/2009 Posts: 8
|
Dear Sir,
After test your component, I found that a lot of code need to be execute from Javascript. However, I am unfamiliar to Javascript, i wonder can we call VB function (under asp.net vb page) from Javascript when everytime the EO component trigger the Javascript ?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
It can be easily done but you will want to use it with care. JavaScript has a purpose, so if you turn everything JavaScript event (client side) into VB function (server side) a lot of things will stop working for you. For example, you can handle "mousemove" event with JavaScript, but if you turn it into a server event (so that you can handle it with VB/C#), the page will immediately stop working because then every mouse move will cause the page to be posted back to and reload from server.
EO.Web Controls includes a ScriptEvent control that is exactly for this purpose. It is documented but not promoted for the reason stated above: it will cause more trouble for you than it solves if you abuse it. For details about how to use this control, see Server API Reference -> EO.Web Namespace -> Classes -> ScriptEvent Class. Note the online version does not have this yet. So you will need to use your local version (.chm help file).
Thanks!
|
Rank: Newbie Groups: Member
Joined: 7/11/2009 Posts: 8
|
Hi, Thank you for your prompt reply !! I will read through and get back to you if any queries. Many thank !!
|