Regenerate JS function in partial postback after full posrback

191 Views Asked by At

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!

1

There are 1 best solutions below

0
On BEST ANSWER

Answered in my first comment to the question.