My server-side ASP.NET code generates a JS function (actual function, e.g. function Foo() {...}) on initial page load using ClientScript.RegisterStartupScript. That function becomes part of ASPX markup and executes when client calls it.
The problem is: I need to modify that function's code in server-side partial postback (Update panel). But when I generate the function with the same name function Foo() {...} via ScriptManager.RegisterStartupScript it doesn't seem to take effect - original function generated in PageLoad's ClientScript.RegisterStartupScript is called.
Is there any way to regenerate client-side function in partial postback after it had been generated on initial page load?
Thanks!
Answered in my first comment to the question.