Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create a Progress Bar from Controller to handle long process in MVC3
    primarykey
    data
    text
    <p>I have a vb.net MVC3 application using RAZOR views. Some of the functions take a long time to complete due to the fact that they are compiling data from the database. During this long wait the browser screen is white and there is no sign that it is doing whats its supposed to other than the activity ring. What I would like to do is create a progress bar, use some simple math on the count method to determine the progress bar percent complete and show this on the screen instead of the plain white browser screen.. I am certain that I would need to do this with a Jquery widget of some sort. And have looked all over google but nothing seems to be hitting on what I am needing here.. The controller function that is called when the White screen is displayed until it is finished is below:</p> <pre><code> Function beginArchive() Dim cList As List(Of cours) = db.courses.ToList For Each x In cList Dim indCourse = x Dim courHfile As String = archiveFiles(x.course_id) Dim arcCourse As New archive arcCourse.cDesc = indCourse.course_description If Not String.IsNullOrEmpty(courHfile) Then arcCourse.cHandouts = courHfile End If arcCourse.cHours = indCourse.course_hours arcCourse.conNum = Convert.ToInt16(indCourse.courseNum) arcCourse.cPre = indCourse.course_prefix arcCourse.cRef = indCourse.course_ref arcCourse.cSpeaker = indCourse.course_speaker arcCourse.cTitle = indCourse.course_title db.archives.AddObject(arcCourse) db.SaveChanges() Dim testSuccess As Integer = delOldFiles(indCourse.course_id) Next Return RedirectToAction("Index", "Admin") End Function </code></pre> <p>Razor View is this:</p> <pre><code>@Code ViewData("Title") = "Archive Previous Conf. Handouts" End Code &lt;fieldset&gt; &lt;h2&gt;You are about to archive all handouts from last years conference. If you continue all of those handouts will be moved to the archive&lt;/h2&gt; &lt;div id="sidebar3"&gt; &lt;p&gt; @Html.ActionLink("Begin Archive", "beginArchive","handoutArchive") @Html.ActionLink("Back to Admin Tools", "Index", "Admin") &lt;/p&gt; &lt;/div&gt; &lt;/fieldset&gt; </code></pre> <p>Any ideas on how I would go about adding a simple progress bar to this which I am assuming would have to be fired by the controller itself...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload