Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
120
ValueChanged event
posted

Hello,

I've recently upgraded an existing project to NetAdvantage 2009 v2.  I've been dynamically creating WebNumericEdit controls, setting their client-side event properties, and adding them to the page programatically.  For example, I had a section in my code that did the following:

WebNumericEdit numericEdit = new WebNumericEdit() { ID = id };

numericEdit.ClientSideEvents.ValueChange = onChangeScript;

parentControl.Controls.Add(numericEdit);

I'd like to take advantage of the new controls in the Aikido framework in order to achieve better performance (some pages end up with a large number of dynamic controls on them).  So I changed the code to look like this:

WebNumericEditor numericEdit = new WebNumericEditor() { ID = id };

numericEdit.ClientEvents.ValueChanged = onChangeScript;

parentControl.Controls.Add(numericEdit);

The problem is that now, when the second line runs, I get the following exception: "Value should contain the name of a javascript function. Space, quote, parenthesis, etc. characters are not allowed."

I understand the meaning of the exception perfectly.  However, I really need the javascript code that fires when the value of the numeric editor is changed to be more than just the name of a javascript function (it is dynamically generated).  This was never a problem before, so I don't understand what the problem is now.

Is there any way in the new framework that I can achieve the same effect that I could get previously?

Thanks,

Ken