Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda