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

No comments:

Post a Comment