Showing posts with label loads. Show all posts
Showing posts with label loads. Show all posts

Wednesday, March 28, 2012

Modal Popup Extender Flash

I'm using the MPE to display a panel that contains a gridview.
It works fine, except that when the page loads (whether it be IE or Mozilla), the panel containing the gridview is visible for a split second and then the MPE hides it. It's kind of confusing to a user - does anybody know how to fix this?

Surround the panel with a div as such:

<div id="divModalPopup" style="display:none"> <asp:Panel ID="pnlModalPopup" runat="server" Height="50px" Width="667px" BackColor="White"><!-- Some content --> </asp:Panel></div>

Thanks,
Chad

Saturday, March 24, 2012

Modal popup with an image loaded from a database

I am having a bit of a problem using a modal popup which loads an image from a database. The image loads fine however the first time each image is loaded the modal popup is stuck at the top of the page with the very top of the modal extending over the top of the page. Once the image is cached and I attempt to view it again everything displays correctly. I'm not sure of the best way to fix this problem. Is there a way to have the popup only load once all of the data within the update panel has completely loaded? Here are a few code snippets so you can get an idea of what I'm doing.


I'm opening the modal when the selected item in the datagrid is changed.

protected void Grid_SelectionChanged(object source, EventArgs e)
{
dispIMG.ImageUrl ="viewImage.aspx?qIID=" + itemDG.SelectedItem.Cells[1].Text +"&sSide=Front";
 ModalPopupExtender.Show();
}
 
Any suggestions as to how I could fix this would be greatly appreciated.
 
cheers
 

any thoughts? I've tried using thread.Sleep to get the image to load before it actually opens the modal, but this doesn't seem to work. Once the image is initially loaded just simply scrolling the screen or reloading it makes everything display correctly. Banging my head on my desk for this one.

~David

Wednesday, March 21, 2012

ModalPopup - content shows briefly when page loads

Hi,

I have a some problem with the modalpopup control. Its on everytime a full postback happens, the browser "displays" all the content of my modalpopup, in way that how it's going to look like when you dont add the extender to your panels. The panels then "disappear" after the page is loaded, and the modalpopups work as they are supposed to.

how do i prevent the panels from "blinking"/showing on full page postbacks?

Add style="display:none;" to the panels.


this seems to work. thanks!

however i have one question. before, I was adding display:none; to my panels through the css class on a separate css file. it wouldnt work that way since the panels will disappear forever. it only works when i put display:none; on the <asp:Panel> from the html source. why is it like that?


I believe that the modalpopup works by toggling the style attribute but if you have display:none permanently set in the CSS then it isn't going to work. Bit of a pain I know but not a huge deal to add it to the panel.

ModalPopup & Screen Flicker

Just as with the other controls, when the page first loads you briefly see the controls before they are hidden. However, with the modal if you set the control's visibility to hidden, it will not display when it's poped up.

Is this a known bug? or someting else?

This behavior happens to me too...
My popup panel is declared as follow, the same as the sample included in the toolkit:

<asp:Panel ID="MoveItemDialogPanel" runat="server" CssClass="modalPopup" style="display:none;" >
...

Urhh ... it's not a bug in Atlas or the toolkit ... it's a problem with the style sheets / CSS that you used. Most, if not all, of the samples work properly as shipped. Hundreds of different posts in the forum over this particular issue.

I've run into the same problem with Collapsible, Hover and ModalPopup. What you have to be really careful of ... is ensuring that if you do copy & paste (which I did) that you ensure that you've got all of the CSS in place as well.

What Atlas (and other Ajax frameworks) are doing is taking advantage of the evolution of browsers and CSS. You get the "fast" response and neat effects in the browser(s) because the markup is already their in the DOM ... it's simply not visible and/or had its behaviors (event sinks) hooked up until necessary. This coupled with "smarter" postbacks (i.e don't post back every possible input field on the page, hidden viewstate, etc) ... result in less over-the-wire data movement ... less processing at the server and an overall "snappier" user experience.

All of this has been doable for years ... it's just really hard to hand-write all that markup and javascript ... and get all the edge cases correct.