That will work for some specific cases. Here's an example, let's say you have 10 color pickers. When a color is picked I need to do something with that color, let's say I want to color a div. Each color picker is associated with a certain div. The question now is how do you "link" each color picker with the right div? Using what you suggest would involve writing a JS method with a big switch statement. By the way, I'm not worried at all about the switch performance issues. That's "slightly" less typing than making 10 separate functions, but still not ideal. If we could pass the ID of the div that needs to be colored to the method that the color pickers call we could eliminate the switch statement altogether. What's more, I could move that JS function outside of the page since now I don't need to worry about any page specific stuff, everything I need would come in via parameters.
I can think of three ways to approach this problem:
1) Give us a second "custom" property that we could use to override the non-custom property. Basically, if that property is not empty use that instead. The downside is that it may confuse some people about the order of importance if they actually provide both.
2) Have a second "parameter" property. If this is present just append to the JS function. For example: OnClientColorChange="MyFunction" OnClientColorChangeParam="abc,def" and it would expect / call a JS function like this MyFunction(sender, eventArgs, abc, def). The upside is that we'll have access to the sender and eventArgs as well as our custom parameters. The downside is that there's even more magic involved than in #1, so harder to explain.
3) The first option would be to analyze the property. If there's a "(" inside it means we're trying to call a custom function.
Example: If we write OnClientColorChange="MyFunction" then the JS would be MyFunction(sender, eventArgs). If we write OnClientColorChange="MyFunction(someid)" then, since there's a "(" in the string and "(" cannot be part of a function name it should just call MyFunction(someid) instead. The advantage is that we'd not pollute all the control is custom or param properties. The downside is that it'd be hard to discover unless you read the docs and we'd not have access to sender and eventArgs.
There may be other ways; right now I'm leaning toward #3. So Telerik, what do you guys think?