0
votes

I have a modal popup extender tied to a asp:panel control that I want to show when the timer on an asp:updatepanel reloads executes the tick method. The tick method calls another method that checks for specific conditions and if all the conditions are met, I call:

ClientScript.RegisterClientScriptBlock(this.GetType(), "key", "$find('modalPopupExtender').show();", true);

I have the TargetControlID on the extender control set to the asp:updatepanel. So far this is not popping up the modal window.

Should I have the TargetControlID set to the timer control inside of the asp:updatepanel???

What am I missing?

2
Could you post some more code? Also, is the modal popup extender inside the update panel? If not try moving it inside. Third question, have you used a js debugger (like IE8 dev tool, firbug for firefox) to verify that the javascript is getting written and then executed update of the update panel? - alanquillin

2 Answers

0
votes

to be safe, I might change your third parameter to:

String.Format("$find('{0}').show();",modalPopupExtender.ClientId)
0
votes

I've tried the above answers and suggestions. I found that putting a dummy div tag on the page with the "runat" set to server and setting the extender control's TargetControlID to the dummy div helped.

I also commented out the ClientScript code and added modalPopupExtender.Show(). This allowed the modal window to be displayed.