Hello,
I would like to try using the CompositeScript functionality provided by the RadScriptManager. However, I'm having difficulty trying to pass in the parameters that I would need in the javascript in order to do to. For example, for the RadNumericTextBox OnValueChaging event, we defined the javascript function to call:
txtAmount.ClientEvents.OnValueChanging = "price_changing";
In the RadScriptBlock, I have the following function:
function
price_changing(sender, args) {
var
strOldValue = args.get_oldValue().toString().replace(
"$"
,
""
);
// 0.00
var
strNewValue = args.get_newValue().toString().replace(
"$"
,
""
);
// 0.00
var
totalfee = parseFloat(document.getElementById(
"<%= lblTotalFee.ClientID %>"
).innerText.replace(
"$"
,
""
));
if
(run_update && (strOldValue != strNewValue)) {
var
grid = $find(
'<%= grdFee.ClientID %>'
);
.....
In order to move the script block into a seperate .JS file, I need to replace "<%= lblTotalFee.ClientID %>" with a variable I can pass into the javascript function. (Or the "<%= grdFee.ClientID %>").
There seems to be no way of doing that, I cannot specify parameters in the ClientEvents.OnValueChanging event.
One way might solve it is to upgrade to .NET 4 (We use .NET 3.5 now), then use the ClientIDMode property, so we can always expect a static ID. But I'm looking for another option.
Any ideas?
Thanks,
Annie