Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have two pages on my website .From first page i am calling a webservice asynchronously but the service takes time to return result so i want to go to next page meanwhile and when i return back to first page it should display the result from webservice if completed ......please guide me how to implement this ?
Posted

I am thinking to implement asynchronous call.

1. In your webservice create an status log fix that has the status (inprogress, completed, error), status message, etc
2. Implement async call in your first page aspx
3. In your second page, read your status log and display to the page and do it every after 1 minute so that the user will not need to refresh the code. you can probably use ajax for the partial page postback :)
 
Share this answer
 
Comments
prejval2006 12-Sep-11 3:52am    
ya but i need to display the result of webservice on first page ....where do i store the result of webservice other than on database
Jephunneh Malazarte 12-Sep-11 21:37pm    
you can store it in an xml file.
why xml?

1. easy to write
2. easy to read

you can probably use xmldocument or xmlwriter objects :)
you can probably use something like this to write an xml file:

VB
Public Sub WriteOutputLogFile(ByVal isCompleted As Boolean, ByVal statusMessage As String)

        Dim writer As New System.Xml.XmlTextWriter("C:\MySampleXmlFile.xml", System.Text.Encoding.UTF8)

        writer.WriteStartDocument(True)
        writer.Formatting = System.Xml.Formatting.Indented
        writer.Indentation = 2
        writer.WriteStartElement("MyOutputog")

        '<statusmessage>Hello World Sample</statusmessage>
        writer.WriteStartElement("StatusMessage")
        writer.WriteString(isCompleted.ToString())
        writer.WriteEndElement()

        writer.WriteEndElement()
        writer.WriteEndDocument()
        writer.Close()


    End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900