Please Wait Image Control

M

MattC

Hi,

I have a webservice that returns a byte[] for an image. I'd like to
disaplay an image while the webservice is being contacted and then once the
byte[] is available show that and remove the please wait image.

I was thinking of trying to use the CallBack mechanism but wondered if AJAX
would be better suited.

I'd really just appreciate some ideas on how this could be acheived. I'll
need to do this many times on a page hence why I want to make each call
asychronous.

TIA

MattC
 
M

MattC

Doesn't the UpdateProgress control fire in reaction to an UpdatePanels
postback event?

The UpdatePanel wont be posting back as the code to get the image is set.

MattC

Siva M said:
ASP.NET AJAX has support for both 'in progress' indication as well as
connecting to web services. For UpdateProgress see
http://ajax.asp.net/docs/tutorials/IntroductionUpdateProgress.aspx

For web service interaction from ASP.NET AJAX:
http://ajax.asp.net/docs/tutorials/ASPNETAJAXWebServicesTutorials.aspx

Hope this helps?

MattC said:
Hi,

I have a webservice that returns a byte[] for an image. I'd like to
disaplay an image while the webservice is being contacted and then once
the
byte[] is available show that and remove the please wait image.

I was thinking of trying to use the CallBack mechanism but wondered if
AJAX
would be better suited.

I'd really just appreciate some ideas on how this could be acheived.
I'll
need to do this many times on a page hence why I want to make each call
asychronous.

TIA

MattC
 
G

Guest

Yes, it is tied to UpdatePanel. I assume you would use one for dynamic image
fetching from your web service?

MattC said:
Doesn't the UpdateProgress control fire in reaction to an UpdatePanels
postback event?

The UpdatePanel wont be posting back as the code to get the image is set.

MattC

Siva M said:
ASP.NET AJAX has support for both 'in progress' indication as well as
connecting to web services. For UpdateProgress see
http://ajax.asp.net/docs/tutorials/IntroductionUpdateProgress.aspx

For web service interaction from ASP.NET AJAX:
http://ajax.asp.net/docs/tutorials/ASPNETAJAXWebServicesTutorials.aspx

Hope this helps?

MattC said:
Hi,

I have a webservice that returns a byte[] for an image. I'd like to
disaplay an image while the webservice is being contacted and then once
the
byte[] is available show that and remove the please wait image.

I was thinking of trying to use the CallBack mechanism but wondered if
AJAX
would be better suited.

I'd really just appreciate some ideas on how this could be acheived.
I'll
need to do this many times on a page hence why I want to make each call
asychronous.

TIA

MattC
 
M

MattC

Is it possible you could give me an example of the calling code. Can you
set multiple update panels to trigger when a page loads? I'm not sure how
to implement your suggestion.

TIA

MattC


Siva M said:
Yes, it is tied to UpdatePanel. I assume you would use one for dynamic
image
fetching from your web service?

MattC said:
Doesn't the UpdateProgress control fire in reaction to an UpdatePanels
postback event?

The UpdatePanel wont be posting back as the code to get the image is set.

MattC

Siva M said:
ASP.NET AJAX has support for both 'in progress' indication as well as
connecting to web services. For UpdateProgress see
http://ajax.asp.net/docs/tutorials/IntroductionUpdateProgress.aspx

For web service interaction from ASP.NET AJAX:
http://ajax.asp.net/docs/tutorials/ASPNETAJAXWebServicesTutorials.aspx

Hope this helps?

:

Hi,

I have a webservice that returns a byte[] for an image. I'd like to
disaplay an image while the webservice is being contacted and then
once
the
byte[] is available show that and remove the please wait image.

I was thinking of trying to use the CallBack mechanism but wondered if
AJAX
would be better suited.

I'd really just appreciate some ideas on how this could be acheived.
I'll
need to do this many times on a page hence why I want to make each
call
asychronous.

TIA

MattC
 
M

MattC

I've done the following:

Made an AJAX call to a webservice that returns my slow generating image via
a byte[]. My problem is how to convert a byte[] in OnCompleteImageService
to an image to set the source!!!

Any ideas??

TIA

MattC

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="TestingGround._Default" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>

<script language="javascript" type="text/javascript">
function GetChartViaService(ID, element)
{
element.onload = "";
var SuccessCallBack = eval('OnComplete' + element.id);
TestingGround.AJAXServices.ChartService.ChartData(ID,
SuccessCallBack, FailedCallback);
}


function OnCompleteImageService(results)
{
//hmm byte[]to image???
document.getElementById('ImageService').src = results;
}


function FailedCallback(error)
{
var stackTrace = error.get_stackTrace();
var message = error.get_message();
var statusCode = error.get_statusCode();
var exceptionType = error.get_exceptionType();
var timedout = error.get_timedOut();

// Display the error.
var RsltElem =
document.getElementById("Results");
RsltElem.innerHTML =
"Stack Trace: " + stackTrace + "<br/>" +
"Service Error: " + message + "<br/>" +
"Status Code: " + statusCode + "<br/>" +
"Exception Type: " + exceptionType + "<br/>" +
"Timedout: " + timedout;
}


</script>

</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Path="~/AJAXServices/ChartService.asmx/js"
/>
</Scripts>
<Services>
<asp:ServiceReference Path="~/AJAXServices/ChartService.asmx"
InlineScript="true"/>
</Services>
</asp:ScriptManager>
<div>
<img alt="Test" id="ImageService" src="UIP.gif"
onload="javascript:GetChartViaService(3, this);" />
</div>

<div id="Results"></div>

</form>
</body>
</html>
Siva M said:
ASP.NET AJAX has support for both 'in progress' indication as well as
connecting to web services. For UpdateProgress see
http://ajax.asp.net/docs/tutorials/IntroductionUpdateProgress.aspx

For web service interaction from ASP.NET AJAX:
http://ajax.asp.net/docs/tutorials/ASPNETAJAXWebServicesTutorials.aspx

Hope this helps?

MattC said:
Hi,

I have a webservice that returns a byte[] for an image. I'd like to
disaplay an image while the webservice is being contacted and then once
the
byte[] is available show that and remove the please wait image.

I was thinking of trying to use the CallBack mechanism but wondered if
AJAX
would be better suited.

I'd really just appreciate some ideas on how this could be acheived.
I'll
need to do this many times on a page hence why I want to make each call
asychronous.

TIA

MattC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top