Not that this issue it totally related to the client side and the time when all the content is completely downloaded, so it does not really matter what it was on the server side, ASP.NET, plain static HTML file, or anything else.
One of the ways to make sure that some processing is done when the page is completely loaded is using jQuery, with its standard usage style pretty much based on that:
http://learn.jquery.com/about-jquery/how-jquery-works[
^].
Pay attention for the top-level script starting with handling
$(document).ready
.
—SA