On the initial page load, the HttpHandler is hit and the images load as expected.
However, when the GridView is refreshed and the UpdatePanel updates, the images are displayed as blank (entirely white). The HttpHandler is getting hit, and the Javascript is getting called. The images are even the correct size. However,
they are just white.
Any ideas?
HttpHandler UpdatePanel "Dynamic Images"
When you ask a question, remember to click "mark as answered" when you get a reply which answers your question.
DisturbedBud...
Star
11523 Points
1911 Posts
Dynamic images appear blank (white) after UpdatePanel update
Nov 01, 2010 10:09 PM|LINK
I have a GridView within an UpdatePanel. The UpdatePanel refreshes on a Timer.
On that GridView is a column of preview images that are dynamically created by resizing the original images.
I lazy load the images after the page has loaded using the Javascript below:
var urls = ''; function saveImageUrl(imgID, url) { urls = urls + imgID + '|' + url + ';'; } function postLoadImages() { if (urls != '') { var images = urls.split(';'); for (var i = 0; i < images.length - 1; i++) { var subparts = images[i].split('|'); $get(subparts[0]).src = 'Code/ImageHandler.ashx?s=tip&url=' + subparts[1]; } urls = ''; } }I call the saveImageUrl() function in the RowDataBound event of the GridView:
var script = string.Format("saveImageUrl('{0}', '{1}');", previewImage.ClientID, imageUrlHiddenField.Value); ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), script, true);On the initial page load, the HttpHandler is hit and the images load as expected.
However, when the GridView is refreshed and the UpdatePanel updates, the images are displayed as blank (entirely white). The HttpHandler is getting hit, and the Javascript is getting called. The images are even the correct size. However, they are just white.
Any ideas?
HttpHandler UpdatePanel "Dynamic Images"
My latest ASP.NET AJAX blog entries.