I've just quickly knocked up a prototpye with an animated gif
I have a page as follows
[PAGE HEADER STUFF]
...
<asp:Image ID="progressImage" ImageUrl="~/progBall.gif" runat="server"/>
<asp:Button ID="DoLongTaskButton" runat="server"
OnClick="LongTaskSimulation" Text="Do Long Task" />
...
[PAGE FOOTER STUFF]
and a C# code behind as follows
[STANDARD USINGS]
[CLASS DEFINITION]
...
protected void Page_Load(object sender, EventArgs e)
{
ProgrssImage.Style.Add("display", "none");
DoLongTaskButton.OnClientClick =
"document."+progressImage.ClientID+".style.display = '';";
}
protected void LongTaskSimulation(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(3000);
}
...
(e-mail address removed) wrote:
hmmm, no it does not seem to work. If you have it working please let me
know.
Perhaps the images must be animated manually by javascript.
-p
mc ha scritto:
How About:-
place the gif on the page and set it's style to "display:none" then in
your code set the onClientClick to some Javascript which un-hides the
image, this will then be visible to the user until the post back has
been completed and the new page is sent out?
never actually tried this myself but it seems to make sense in my head!
Have you thought about Atlas? You can use an update progress control to
display some custom text/graphic whilst the Ajax post back is
completing.
(e-mail address removed) wrote:
I see

Thanks bruce.
Apart animated gif, is there any simple solution I can use to entertain
the user during a long running task, possibly without spending a week
to implement it ? I have seen some of such nice animations, but I am
unsure about the technology they used.
-Pam
bruce barker (sqlwork.com) ha scritto:
this will not work. in the asp.net from processing model, a button
click
posts back, and the page is rebuilt and sent back to the browser.
this means
the brwser will not see the html to display the gif until all the
server
processing is done.
you can set the gif with client code, but in general animated gifs
will not
run during a postback. the best solution is start the long running
process
in a background thread, and poll for completion. google this
newgroup for
processing message, and you shoudl find examples.
-- bruce (sqlwork.com)
I am reposting hoping better luck
I can't achieve this simple thing: I have an animated gif in an image
control (ImageProgress1). The image visibility is set to false. I
want
that when the User click on a given button (ButtonSomeLongTask) to
execute a long task Me.ImageProgress1 become visible until the
task on
the server is finished. I call the task this way:
Protected Sub ButtonSomeLongTask_Click(ByVal sender As Object, ByVal
e As System.EventArgs) Handles ButtonSomeLongTast.Click
ExecuteLongTask() 'here there is a call to a web service
End Sub
Any *simple* example to do it?
-Pam