0

I have an asp page that when accessed it loads up a large grid view of a bunch of data. This can sometimes take a decent amount of time to load because it is a lot of info. If someone clicks the ImageButton to load up a calendar while the page is still loading it will mess up the page and make the page reload. So I'm wondering how I can get it to wait until the page is fully loaded to enable the button. I can have it disabled at the start but I need a way to detect when the page is fully done loading. My program is using a vb.Net code behind by the way. Any help would be greatly appreciated, thank you so much!

  • 1
    Depending on how the grid view is being populated, [Pure JavaScript equivalent of jQuery's $.ready() - how to call a function when the page/DOM is ready for it](https://stackoverflow.com/q/9899372/1115360) might be the answer for you, if you have JavaScript to enable the button and start with it disabled. – Andrew Morton Feb 06 '20 at 20:28
  • 1
    @AndrewMorton Thanks for the response. I tried fiddling around with what they were mentioning in that link you sent, but for some reason it wasn't working for me. I just got it to work by changing up my strategy though. Instead of disabling the button until the page is loaded, I figured out if I put the button in an update panel, clicking it won't update the whole page, just that panel. So its actually an easier way to fix the problem I had. Thanks for your help though, I appreciate it! – FeenyFan123 Feb 07 '20 at 16:31

0 Answers0