Hi guys,
I am writing an asp.net application (C#, .NET 1.1 and AjaxPro 6.9.14.1,
IIS 5.1, for IE only). When I first wrote the ajax part to getting an
image from the server, it lost the very first invocation of the
callback function. But the image displayed when I made the same request
again. Since then, it has worked fine.
But a week later (No code was changed), the app stopped working. I
debugged the application and found the ajax method did get called and
receive the image url from the server. But the callback function were
somewhat not invoked at all, which is supposed to post the image on the
web page. I changed the callback function to its full name
(top.ImgFrame.postImg_CallBack). The callback function got invoked
again but just for a short while. I also switched to sync call as below
and made it working. But the app really needs the callback function to
remain responsive during the image retrieval.
There has been no error thrown out, including javascript errors. The
retrieval time is probably 10 or 20 seconds. My application uses a few
frames, but the ajax call and the callback func in question are in the
same frame (can't get confused about the js function in different
frames?!). I am new to Ajax.NET and have no idea how a callback gets
invoked. I am totally lost and do need help or hint about this issue.
Thank you so much!
Below is the code snippet.
=======> MainFrame.htm (body.onload, somebutton.onclick), always be
loaded first
function postImage() {
top.ImgFrame.getImage();
}
=======> ImgFrame.htm
function getImage() {
ImgMgr.retrieveImageUrl(postImg_CallBack);
// full name
//ImgMgr.retrieveImageUrl(top.ImgFrame.postImg_CallBack);
// sync call
//var resp = ImgMgr.retrieveImageUrl();
//postImg_CallBack(resp);
}
function postImg_CallBack(resp) {
if (resp.error != null) {
alert("error");
} else {
document.getElementById("theImage").src= resp.value;
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info/
Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---