[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
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
Re: AJAX texbox - Get continous real-time output from Windows Service
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
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?
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
Re: AJAX texbox - Get continous real-time output from Windows Service
Thanks..
It works beautifully :)
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?
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
Re: AJAX texbox - Get continous real-time output from Windows Service
Re: [RESOLVED] AJAX texbox - Get continous real-time output from Windows Service
Hey,
Glad to hear it!!
Gary