Base solution for your next web application
Open Closed

Progress Bar #4143


User avatar
0
verrrrrrrrrrrrrdi created

Hi,

Can you give me a sample how to implement progress bar using Signal R and Angular JS? I'm using ASP.Net MVC 5.x + Angular JS Template. Any help would be appreciate it. Thanks


6 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Verrrrrrrrrrrrrdi,

    We don't have such an example. Have you made any progress on this ? We can try to help you if you have any specific problems.

  • User Avatar
    0
    verrrrrrrrrrrrrdi created

    Hi @ismcagdas,

    Yes i have implement SignalR hub and manager on web layer.

    I have create simple loop to show progress result to UI

    [HttpPost]
            public ActionResult DoJob()
            {
                var job = JobManager.Instance.DoJobAsync(j =>
                {
                    for (var progress = 0; progress <= 100; progress++)
                    {
                        if (j.CancellationToken.IsCancellationRequested)
                        {
                            return;
                        }
    
                        Thread.Sleep(200);
                        j.ReportProgress(progress);
                    }
                });
    
                return Json(new
                {
                    JobId = job.Id,
                    Progress = job.Progress
                });
            }
    

    i have problem to connect from this ProgressController to My service in Application layer. can you give me a step by step how to solve this? Any help would be appreciate it!

  • User Avatar
    0
    verrrrrrrrrrrrrdi created

    Hi,

    Any help??

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Have you seen this example <a class="postlink" href="https://stackoverflow.com/a/37674412/6681451">https://stackoverflow.com/a/37674412/6681451</a>. It is exactly what you are looking for.

  • User Avatar
    0
    verrrrrrrrrrrrrdi created

    Hi,

    I have successfully implement using simple loop on Controller, but my problem now is how to integrate real loop to processing data on MyAppService on Application Layer?

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Verrrrrrrrrrrrrdi,

    It should be similar like you did in controller. Where do oyu have problem ? Can you share your app service code ?