I added these codes in the javascript file
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_pageLoaded(CheckLoadBody);
This will be triggered each time when the Updatepanel loads,so I can able to call the method when i access the transaction page second time.
i.e.When the Updatepanel is loaded the method is triggered.
But the problem is If I access the Cashdeposit first time and the CashWithdrawal secondtime,
During Cashwithdrawal its calling the load method of cashdeposit also.
This is because when I initially load the CashDeposit CashDeposit.js is is added.
And if I access CashWithdrawal CashWithdrawal.js is added,here I have to remove the script reference of CashDeposit.js
So is there anyway to remove the script file that is initially added when I access the new transaction?
This is the Code I used to add the Javascript file dynamically
<asp:ScriptManagerProxy runat="server" ID="scrMain">
</asp:ScriptManagerProxy>
string txnJS = "../ClientScripts/" + SessionManager.CurrentTransName + ".js";
ScriptReference dynamicJS = new ScriptReference(txnJS);
scrMain.Scripts.Add(dynamicJS);
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).