Results 1 to 11 of 11

Thread: [RESOLVED] AJAX texbox - Get continous real-time output from Windows Service

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    146

    Resolved [RESOLVED] AJAX texbox - Get continous real-time output from Windows Service

    My Windows Service outputs some information continuously.
    I'm intending to display that output on a webpage in real time.
    What would be the easiest way to go about this?


    I'm thinking of making the page access the windows service through remoting. (Make a remotable object and call its method in some periodic interval to get the output from the windows service).

    I can handle that part.

    But I am kinda blur how to actually display the output on the webpage.

    Should I use a textbox with auto-fresh (if there's such a thing)
    or should I use AJAX?


    Sorry I'm very new to ASP.NET. But i am familiar with C# and VB
    Last edited by winterslam; Nov 2nd, 2009 at 08:17 AM.

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: AJAX texbox - Get continous real-time output from Windows Service

    Hey,

    You don't have to apologise, everyone has to start somewhere

    I would suggest that you take a look at the following:

    http://www.asp.net/AJAX/Documentatio...ebService.aspx

    Hope that helps!!

    Gary

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    146

    Re: AJAX texbox - Get continous real-time output from Windows Service

    Thanks

    I'll read it

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: AJAX texbox - Get continous real-time output from Windows Service

    Hey,

    Sounds like a plan. Let me know if you have any questions.

    Gary

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    146

    Re: AJAX texbox - Get continous real-time output from Windows Service

    I now have a basic idea.


    1. Make a Web Service to get messages from the Windows Service through IPC remoting
    2. Implement UpdatePanel Control and Script Manager.
    3. Put a textbox and a button on the updatepanel


    Whenever user clicks on the button, the script manager gets messages from the Web Service and appends them to the textbox.


    That part is pretty clear. But what if I want the script manager to get messages from the Web Service periodically rather than waiting for the click event of the button to be triggered?

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: AJAX texbox - Get continous real-time output from Windows Service

    Hey,

    You could always implement an AJAX timer which runs the code that would be run when the user clicks the button.

    Gary

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    146

    Re: AJAX texbox - Get continous real-time output from Windows Service

    Thanks..

    It works beautifully

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    146

    Re: AJAX texbox - Get continous real-time output from Windows Service

    Code:
     protected void Timer1_Tick(object sender, EventArgs e)
        {
            localhost.WebService temp = new localhost.WebService();
            TextBox1.Text += Environment.NewLine + temp.GetOutput();
        }
    One last thing I want to do is to make the textbox scroll automatically to the bottom as new entries are added.

    How do I do it?

  9. #9
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: AJAX texbox - Get continous real-time output from Windows Service

    Hey,

    I am assuming that you are using a MultiLine Textbox.

    One way you could do this would be to update the position of the TextArea which is rendered to the page in Client Side Script when the page loads.

    Have a look here for more information:

    http://weblogs.asp.net/skillet/archi...24/395838.aspx

    Hope that helps!!

    Gary

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    146

    Re: AJAX texbox - Get continous real-time output from Windows Service

    Thanks.


    Problem solved

  11. #11
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: [RESOLVED] AJAX texbox - Get continous real-time output from Windows Service

    Hey,

    Glad to hear it!!

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width