What kind of "event handler" are you talking about? Is that the ASP.NET
page model? What else does the page contain besides the code for the
event handler?
Thanks for your reply Martin.
Its VB.NET/ASP.NET 2.0 and the event handler is a custom handler that
gets fired every time a byte is sent to a remote server for FTP. The
only
other method on the page is a Page_Load event that handles the upload
of the files. Below is the event handler. I currently get a parser
error becuase
it keeps recreating the XML every time the event handler fires and I
cant
figure out how to avoid this - I need to replace/update it, not append
to it.
Public Sub onIncrementCallback(ByVal sender As Object, ByVal e As
IncrementEventArgs)
Dim sbhtml As StringBuilder = New StringBuilder
sbhtml.Append("<?xml version='1.0' encoding='ISO-8859-1'?
sbhtml.Append("<uploads>")
sbhtml.Append("<upload>")
sbhtml.Append("<filename>")
sbhtml.Append(e.FileName)
sbhtml.Append("</filename>")
sbhtml.Append("<bytessent>")
sbhtml.Append(e.BytesSent)
sbhtml.Append("</bytessent>")
sbhtml.Append("<filesize>")
sbhtml.Append(e.TotalBytesToSend)
sbhtml.Append("</filesize>")
sbhtml.Append("<percent>")
sbhtml.Append(e.ProgressPercentage)
sbhtml.Append("</percent>")
sbhtml.Append("</upload>")
sbhtml.Append("</uploads>")
Context.Response.ContentType = "text/xml"
Response.Write(sbhtml.ToString)
End Sub
Thanks for your help,
Peter