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. General Programming
  3. C#
  4. How can I show an animated loding icon beside teh dropdown box when postback occurs.

How can I show an animated loding icon beside teh dropdown box when postback occurs.

Scheduled Pinned Locked Moved C#
sysadminquestion
6 Posts 4 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.
  • J Offline
    J Offline
    JUNEYT
    wrote on last edited by
    #1

    Hello, My aim is to show an animated loading icon beside the dropdownbox. When dropdownbox performs a postback the icon should appear and when it gets loaded completely, the icon should disappear. How can I succeed it in client side instead of in server side. Would you please let me know how I can accomplish this. Thanks.

    What a curious mind needs to discover knowledge is noting else than a pin-hole.

    N M 2 Replies Last reply
    0
    • J JUNEYT

      Hello, My aim is to show an animated loading icon beside the dropdownbox. When dropdownbox performs a postback the icon should appear and when it gets loaded completely, the icon should disappear. How can I succeed it in client side instead of in server side. Would you please let me know how I can accomplish this. Thanks.

      What a curious mind needs to discover knowledge is noting else than a pin-hole.

      N Offline
      N Offline
      Nagy Vilmos
      wrote on last edited by
      #2

      The easiest would be to display an animated gif[^] and then hid it once the load is completed. That way you will never need to worry about the animation, just that it is visible or not.


      Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

      1 Reply Last reply
      0
      • J JUNEYT

        Hello, My aim is to show an animated loading icon beside the dropdownbox. When dropdownbox performs a postback the icon should appear and when it gets loaded completely, the icon should disappear. How can I succeed it in client side instead of in server side. Would you please let me know how I can accomplish this. Thanks.

        What a curious mind needs to discover knowledge is noting else than a pin-hole.

        M Offline
        M Offline
        Morgs Morgan
        wrote on last edited by
        #3

        First download animated gif: - http://www.preloaders.net/[^] - http://www.ajaxload.info/[^] html:

        loading...

        javascript/jQuery:

        function ShowHideLoader( divLoader )
        {
        if($( divLoader ).is(':visible'))
        $( divLoader ).hide();
        //or
        //$( divLoader ).css({display: 'none'});
        else
        $( divLoader ).show();
        //or
        //$( divLoader ).css({display: 'block'});

        }

        Hope that helps, Morgs

        B 1 Reply Last reply
        0
        • M Morgs Morgan

          First download animated gif: - http://www.preloaders.net/[^] - http://www.ajaxload.info/[^] html:

          loading...

          javascript/jQuery:

          function ShowHideLoader( divLoader )
          {
          if($( divLoader ).is(':visible'))
          $( divLoader ).hide();
          //or
          //$( divLoader ).css({display: 'none'});
          else
          $( divLoader ).show();
          //or
          //$( divLoader ).css({display: 'block'});

          }

          Hope that helps, Morgs

          B Offline
          B Offline
          BobJanova
          wrote on last edited by
          #4

          This seems to be only a partial answer; how do you hide it again when the server acknowledges the postback? I'm not really sure how the ASP.net partial postback actually works, and although it's obviously using AJAX underneath, whether there is somewhere you can hang a JS event handler from that will tell you when the response comes back.

          M 1 Reply Last reply
          0
          • B BobJanova

            This seems to be only a partial answer; how do you hide it again when the server acknowledges the postback? I'm not really sure how the ASP.net partial postback actually works, and although it's obviously using AJAX underneath, whether there is somewhere you can hang a JS event handler from that will tell you when the response comes back.

            M Offline
            M Offline
            Morgs Morgan
            wrote on last edited by
            #5

            Hi there, I made the function clever enough to do one of the possible two things. I call the function "ShowHide" meaning it can show or hide the animated gif. The function checks if the gif is visible and hides it otherwise shows it. So, just call the same function to show or hide it, safe and sound. Goodluck, Morgs

            B 1 Reply Last reply
            0
            • M Morgs Morgan

              Hi there, I made the function clever enough to do one of the possible two things. I call the function "ShowHide" meaning it can show or hide the animated gif. The function checks if the gif is visible and hides it otherwise shows it. So, just call the same function to show or hide it, safe and sound. Goodluck, Morgs

              B Offline
              B Offline
              BobJanova
              wrote on last edited by
              #6

              Yes, but you only show how to call it on postback, not on postback response.

              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