Vince C. wrote:
"Bob Barrows" <re******@NOyahoo.SPAMcom> a écrit dans le message de
news:On**************@TK2MSFTNGP09.phx.gbl...
[...] No. There is no way to do this in server-side ASP code.
On client-side, if you use data binding, you will have some builtin
events
to use. Please follow up in a client-side code newsgroup
(m.p.scripting.* or one of the groups with dhtml in its name.)
Thanks, Bob.
I knew I could do this on the client side. Too bad it can't be done
sever-side. Do you know why it is not supported on server side? Is
this a security issue or something else? It's even more sad because
both IIS and IE share the same script engine(s).
Vince C.
It's a limitation of the scripting engine: an object cannot be declared
WithEvents because script variables are variants. In order for a variable to
be defined with events, it has to be defined with a specific object type
when it is declared, in order for the event model to be set up (different
object types have different events, right?). You cannot declare a variant
with events, because the engine has no idea which events might apply.
With client-side code, you have the DOM to work with. The DOM is totally
separate from the script engines.
Anyways, events are intended to be user-driven, not code-driven. It is
assumed that the programmer can write code to call when his code does
something that needs a response.
Sorry,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"