Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
Show data that is obtained from command line process in ASP.NET MVC

In c# wpf, I can add command-line-based apps to my app and send input and show the output in a richtextbox using System.Diagnostics. Now I wanna implement this in ASP.NET MVC.

I know how to send data from javascript to a controller using ajax and the controller does some processing and returns a result and shows it in view. but the thing is, the data from that process is receiving asynchronously by an event like this:

private void SortOutputHandler(object sendingProcess, DataReceivedEventArgs outLine)
{
  // For each line that is printed in the console, this event will be executed and the 
  // text from that line can be received by outLine.data
}

What I'm trying to do is add this received text (outline.data) to a paragraph in view asynchronously. Ajax only works if I wanted to run an ActionResult method and wait for my response and after all of the lines are received, then it will send the result back to javascript. But I want to show every received line exactly the moment it arrived in view. How can I do it?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Using SignalR solved my issue. With that library, I could call an asp.net function and send data in javascript and vice versa. to recognize every client, I stored their connection id to send the result back to them when it's ready.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!