Modal Popup flash

  • Thread starter Thread starter DavidC
  • Start date Start date
D

DavidC

I added a modal popup to my asp.net page and it works great. However, every
time I open the page the modal popup panel flashes and then disappears. I am
using framework 3.5 and wondered how I can avoid the flash when opening the
page. Thanks.
 
I added a modal popup to my asp.net page and it works great. However, every
time I open the page the modal popup panel flashes and then disappears. Iam
using framework 3.5 and wondered how I can avoid the flash when opening the
page.  Thanks.

Are you sure that you do not show it in code behind or on the client
during page load?
 
Alexey Smirnov said:
Are you sure that you do not show it in code behind or on the client
during page load?
.

The Panel is not hidden when page loads. Should it be visible = false and
then the ModalPopup control will make it visible? Thanks.

David
 
Hi David,
I had the same problem, what you can do is set the “popupcontroid†panel to
absolute position to remove it off the screen. That will not cause the panel
to flicker during page load.


sample code
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
TargetControlID="lnkSelectTheme"
PopupControlID="pnlThemSelector"
BackgroundCssClass="modalBackground" CancelControlID="btnCancelSelectTheme">
</asp:ModalPopupExtender>
<asp:Panel ID="pnlThemSelector" runat="server" Width="200px"
BackColor="White" Style="position: absolute;
top: 200060px; left: 2200000px;">
<asp:Panel ID="pnlThemeSelectorDrag" runat="server" Width="200px"
BackColor="Gray">
</asp:Panel>
<asp:Panel ID="pnlthemeoptions" runat="server" BackColor="White">
<asp:RadioButtonList runat="server" ID="rblThemes">
<asp:ListItem Text="Green"></asp:ListItem>
<asp:ListItem Text="Blue"></asp:ListItem>
<asp:ListItem Text="Purple"></asp:ListItem>
<asp:ListItem Text="Orange"></asp:ListItem>
</asp:RadioButtonList>
<span class="art-button-wrapper"><span class="l"></span>
<span class="r"></span>
<asp:Button ID="btnSelectTheme" runat="server" Text="Select"
class="art-button" OnClick="btnSelectTheme_Click" />
</span><span class="art-button-wrapper"><span
class="l"></span><span class="r"></span>
<asp:Button ID="btnCancelSelectTheme" runat="server"
Text="Exit" class="art-button" />
</span>
</asp:Panel>
</asp:Panel>
 
Back
Top