TheWizardofInt Posted November 27, 2006 Posted November 27, 2006 This was one of those things that was too easy to get, so I thought I would post it here and save the next person some grief In your master template, put this in your code behind: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then 'create an image here - this can be any img that already exists on the site Response.Write("<img id='img1' src ='images/red-x.gif' Style='left: 500px; position: absolute; top: 200px' />") Response.Write("<script language=javascript>;") Response.Write("var dots = 0;") Response.Write("var dotmax = 10;") Response.Write("function ShowWait(){") Response.Write("}") Response.Write("function StartShowWait(){") Response.Write("var output;") Response.Write("output=document.getElementById('img1');") Response.Write("output.style.visibility='visible';") Response.Write("window.setInterval('ShowWait()',1000);") Response.Write("}") Response.Write("function HideWait(){") Response.Write("var output;") Response.Write("output=document.getElementById('img1');") Response.Write("output.style.visibility = 'hidden';") Response.Write("window.clearInterval();") Response.Write("}") Response.Write("StartShowWait();</script>") Response.Flush() Thread.Sleep(10000) End If End Sub At the top of the page, add 'Imports System.Threading to accomodate the Thread.Sleep Now, on the HTML source for the Master Template page, go to the Body line and add onload="HideWait(); Don't forget the semicolon or it won't work Now this image pops up as pages load and, when the page is DONE loading, it executes the Javascript 'HideWait' function and kills the image. You don't have to do anything to any of the other pages Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.