Ajax Question

Ajax Question

Old forum URL: forums.lhotka.net/forums/t/6321.aspx


SouthSpawn posted on Tuesday, February 03, 2009

I know this might not be the place to ask this, but in all honesty, this is my favorite development message board.
 
I have a FTP component that has an event that fires during uploading or downloading a file using the FTP component.
 
I would like to somehow send a response back to the client every time this "Server Side" event is fired. Therefore the client can update the progress bar.
 
I am lost here. Every code example that I see, I just get more lost.
 
Can anyone please give me some suggestions or code samples on how I can update a webpage during the time a server side event is firing.

Code Samples anyone???

Thanks

JoOfMetL replied on Tuesday, February 03, 2009


Only client can call the server. You can query the server periodically to get its status, and you can update your progress bar

SouthSpawn replied on Tuesday, February 03, 2009

So you are saying I would have to do something like this.

Private
Sub Ftp_OnTransfer(ByVal sender As Object, ByVal e As nsoftware.IPWorks.FtpTransferEventArgs) Handles Ftp.OnTransfer

Session("Percentage") = e.PercentDone

End Sub

Public Function PercentageDone() As String
      Return Ctype(Session("Percentage"), String)
End Function

Then on the client side, use a timer to call my PercentageDone method every second to see the value?

Is that the way you would do this?

Thanks for suggestions.

JoOfMetL replied on Wednesday, February 04, 2009


Yes, I think this solution should work. :-)

Copyright (c) Marimer LLC