Question : avoid execution of javascript on postback with updatepanel and timer

I have a masterpage with an updatepanel and a timer in it. Another page shows some data in a gridview.
Within the gridview in edititemtemplate there are two dropdownlists c1 and c2 .
I add a javascript function on Gridview_RowDataBound when it's in editmode with Sys.Application.add_load and ScriptManager.RegisterStartupScript. The javascript toggles the display style (block or none) of c2 depending on the value of c1 and calls the javascript function scrollintoview on c2. I'm sure by reading you know what's happening: Each time the timer fires, my c2 is scrolled into view. So the question is:

How do I avoid multiple calls to a javascript function registered as startupscript when the timer fires?



Answer : avoid execution of javascript on postback with updatepanel and timer

cant you add the flag to script like this

;) I hope you get the idea below (it may contain syntax errors)
1:
s = "Sys.Application.add_load(var "& divAE.ClientID &"_fired = false; InitToggleAE" & divAE.ClientID & ");function InitToggleAE" & divAE.ClientID & "() {if (!"& divAE.ClientID &"_fired) toggleDisplay('" & divAE.ClientID & "'," & Convert.ToInt32(ddlAE.SelectedValue) & ");"& divAE.ClientID &"_fired = true};"
Random Solutions  
 
programming4us programming4us