How do I create an extender control property that will refer to a client function handler (or client object, or any client expression)?
If I create an extender propety as string (eg. string Property1), it will be rendered in client control creation as a quoted string:
$created(myComponent,{"Property1" : "value in quotes", ...
However I want it to be passed as client-side expression like that:
$create(myComponent,{"Property1": value without quotes, ...
I need something similar to ExtenderControlEvent attribute, which references a client-side handler, but it can only reference the ajax handler like MyFunction(EventArgs), and not any function with custom parameters, nor any custom client object).
In your client-side setter for the property, you can use: "this._expression = eval(value);".I would suggest that, in your server-side setter, you make sure to check to make sure the developer doesn't try to use any parameters and to remove "()" from the value. If you don't, the above expression will execute the function and set this._expression to the return value of that function instead of setting this._expression to the function itself.
Hope that helps.
No comments:
Post a Comment