I've run into an issue where I need to update a JavaScript variable after post-back. My initial approach was to use the ClientScript.RegisterStartupScript function, which worked fine during the first page load but failed on subsequent postbacks. I included the following line in the page_load function and suspect that the key cannot be added multiple times. The structure of my setup involves a master page and content page, with this call originating from the content page.
ClientScript.RegisterStartupScript(typeof(Page), "SymbolError", "<script type='text/javascript'>alert('Error !!!');</script>");
Is there a more efficient way to invoke a JavaScript function from the back-end?
Appreciate any help or advice.