var orderTotal = $find('<%= OrderTotal.ClientID %>').get_value();
...for use in some client-side stuff. This works fine.
However, occasionally the value of this RadNumericTextBox is changed through a CallBack, with the change being made from the Code-Behind. The value of the RadNumericTextBox changes in the browser, and everything seems to work fine there too.
BUT if I then call the Javascript function again, to get the value, it gives me the old value, as if the CallBack had never been made and the value of the RadNumericTextBox had never been changed. What is going on?
I need to always be pulling the proper, current value of the RadNumericTextBox with my Javascript function.
Thanks!
6 Answers, 1 is accepted
Please confirm that the javascript is correctly called after the Ajax request. Please review the following help topic for more information on this matter.
Kind regards,
Maria Ilieva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Could you please post some more code shows the Ajax settings so we could further research on the problem.
Kind regards,
Maria Ilieva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Could you please post some more code shows the Ajax settings so we could further research on the problem?
Kind regards,
Maria Ilieva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
private void OrderTotalCallback_Callback(object sender, ComponentArt.Web.UI.CallBackEventArgs e) |
{ |
ResetOrderTotal(); |
OrderTotal.RenderControl(e.Output); |
} |
private void ResetOrderTotal() |
{ |
double total = 0; |
foreach (ComponentArt.Web.UI.GridItem item in OrderProductsGrid.Items) |
{ |
if (item["ordprdCostOverride"] == DBNull.Value) |
{ |
total += Convert.ToDouble(item["ordprdTotal"]); |
} |
else |
{ |
total += Convert.ToDouble(item["ordprdCostOverride"]); |
} |
} |
OrderTotal.Value = total; |
} |
function calculateWeightedTotal() { |
var orderTotal = $find('<%= OrderTotal.ClientID %>').get_value(); |
if (orderTotal == '') orderTotal = 0; |
var probability = $find('<%= Probability.ClientID %>').get_value(); |
$find('<%= WeightedTotal.ClientID %>').set_value(orderTotal * probability / 100); |
} |
I'm not able to see the Ajax settings in the code you have provided. Could you please let me know how the ajax is set on the Page. Are you using RadAjaxManager or RadaAjaxPanel controls? In order to execute the javascript correctly after ajax request you should use the ResponseScripts property of the RadAjaxPanel or RadAjaxManager
Kind regards,
Maria Ilieva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.