in

ASP.NET Weblogs

Andy Smith's Blog

Page.RegisterStartupScript('Andy', 'MetaBuilders_WebControls_GainKnowledge();');

Eric 'jscript' Lippert on multicast delegates in script

Step 1) read this
Step 2) goto your aspnet_client folder, open any version of WebUIValidation.js, and search for “function ValidatorHookupControl(control, val) {“ ( linked for your pleasure )
Step 3) Notice that I have no qualms about not protecting the guilty.

I'm fairly certain the original "abuse" script that Eric is talking about comes from the asp.net validation script library. At least, that's the first time I saw something of that nature. Having to solve a similar problem myself while building one of my very first server controls, I figured that since (A) I had essentially zero jscript knowledge at the time, and (B) “If the asp.net team does it that way, then it's good”, so I copied the technique for ConfirmedButtons.

I've since found a way of multicasting events that I like much better.

Comments

 

Eric Lippert said:

Actually, no, that was not the code I was referring to. But I'll bet you a dollar that the customer that DID send it to me did what you did -- copied the code right out of the sample.

Thank you so much for bringing that to my attention. I'll see what I can do about getting this sample fixed.
December 12, 2003 5:02 PM

Leave a Comment

(required)  
(optional)
(required)  
Add