.NET Nugget: Modal Popup Extender Flicker (Saturday, November 14, 2009 7:30:00 PM)
divider

Thought I'd share this nifty little .NET finding I came across tonight.  Been coding through a cold here, so excuse me if my grammar is a little ... how shall I say? **## Nyquil !!!!!.

Yeah, that's the good stuff.   Anyways, on to the info.

The AJAX Control Toolkit is pretty much the coolest thing since sliced bread (or Orb, which is also the coolest thing since sliced bread.  Thats' 2 things.  Take that bakers.)  I've been using little bits and pieces of it for the last 2 years now, and one of them I hadn't actually tested yet was the ModalPopupExtender.

This control should extend an asp:Panel (or div, whatever) to popup in a "modal" fashion when a certain button is clicked, then disappear when the user responds to the modal popup.

My problem, and apparently everyone else's was that upon submitting information within the modal popup, I'd get this hideous flicker of the popup panel during the postback.  I'm not talking a minor distraction here either.  It's all mispositioned and scattered across the page for a good half second during the postback.

My initial thought was to hard code a "display:none" into the panel control.  Through my searching of this problem later on I found that another guy named Matt Berseth had used this same method and gotten rid of the flicker.  Unfortunately, this didn't work for me.

I tried other things like a client side script to turn the visibility on/off for the panel:  no luck.  I tried changing from a panel to a div.  I tried turning off my stylesheet to make sure that wasn't causing a problem.  Still, no dice.

Finally though, I found the problem:

 <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" DropShadow = "true" PopupControlID="popupDiv" TargetControlID="btn_createAcct" CancelControlID="btn_cancel" >

Are you thinking what I'm thinking?  Yes, a dropshadow would be an entirely separate panel laying below the panel I'm working with.  That's what the problem was.

.NET renders your normal div or asp:Panel named "kevinPanel" like this now:





 Commentsdivider



Enter a New Comment Below

Subject:

Enter Your Name (Required):


Enter your comments about this blog entry:



   












Other Interesting Shit...
line break

NewmanCam

NewmanCam Pic 

 

Where am I at Right Now?

Since I've been sort of nomadic lately, now you can look at this little widget dealie and see where I'm at and what the weather is there. Nifty, eh?