Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Looking for help implementing a progress bar in ASP

Looking for help implementing a progress bar in ASP

Scheduled Pinned Locked Moved ASP.NET
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    turbosupramk3
    wrote on last edited by
    #1

    I am seeing the alert textbox, but my progress bar does not increment, can anyone tell me what I've done wrong? The static value does work. Thanks

    <asp:FileUpload ID="thefile" runat="server" onchange="readURL(this);fill_out_filesize(this.files[0].size);progressBar();" itemid="thefile" value="thefile" Width="347px" />

    function progressBar() {
    //$("#progressbar").progressbar({
    // value: 37
    //});
    alert("test");
    var variable = 1;
    var result = 0;
    do {
    result = ++variable
    $("#progressbar").progressbar({
    value: result
    });
    sleepFor(2000);
    } while (true);
    }

    function sleepFor(sleepDuration) {
    var now = new Date().getTime();
    while (new Date().getTime() < now + sleepDuration) { /* do nothing */ }
    }

    T 1 Reply Last reply
    0
    • T turbosupramk3

      I am seeing the alert textbox, but my progress bar does not increment, can anyone tell me what I've done wrong? The static value does work. Thanks

      <asp:FileUpload ID="thefile" runat="server" onchange="readURL(this);fill_out_filesize(this.files[0].size);progressBar();" itemid="thefile" value="thefile" Width="347px" />

      function progressBar() {
      //$("#progressbar").progressbar({
      // value: 37
      //});
      alert("test");
      var variable = 1;
      var result = 0;
      do {
      result = ++variable
      $("#progressbar").progressbar({
      value: result
      });
      sleepFor(2000);
      } while (true);
      }

      function sleepFor(sleepDuration) {
      var now = new Date().getTime();
      while (new Date().getTime() < now + sleepDuration) { /* do nothing */ }
      }

      T Offline
      T Offline
      turbosupramk3
      wrote on last edited by
      #2

      This is exactly what I want, only I am not sure how to implement into my code and where? I've tried and done so unsuccessfully because it is still not working Edit fiddle - JSFiddle[^]

      T 1 Reply Last reply
      0
      • T turbosupramk3

        This is exactly what I want, only I am not sure how to implement into my code and where? I've tried and done so unsuccessfully because it is still not working Edit fiddle - JSFiddle[^]

        T Offline
        T Offline
        trust trinity
        wrote on last edited by
        #3

        <h2>Dynamic Progress Bar</h2> <div class="w3-progress-container"> <div id="myBar" class="w3-progressbar w3-green" style="width:1%"></div> </div> <br> <button class="w3-btn w3-dark-grey" onclick="move()">Click Me</button> <script> function move() { var elem = document.getElementById("myBar"); var width = 1; var id = setInterval(frame, 10); function frame() { if (width >= 100) { clearInterval(id); } else { width++; elem.style.width = width + '%'; } } } </script>

        trust mauchaza #facebook

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups