Hi
I have a page that has a lot of data on it. What I want to do is the following (taken from this site as ref : http://www.weberdev.com/get_example-4...) :
1. Add a div that is full page width and height, that has a loading message in it, and that overlays the rest of the skin.
2. then add an onload event to the body tag, that will hide this loading div once the page has loaded completely using css (ie. set display:none;).
So, what I did is the following :
Added this at teh top of the ascx file, underneath the <%@ tags :
<script runat="server">
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
Dim body As System.Web.UI.HtmlControls.HtmlGenericControl = CType(Page.FindControl("body"), System.Web.UI.HtmlControls.HtmlGenericControl)
body.Attributes("onLoad") = "document.getElementById('loading').style.display = 'none';"
End Sub
</script>
then added this to my index.ascx file above the rest of my skin code (no styling yet - just wanting to see if the div will disappear once the page has loaded : <div id="loading">Invitation loading ...</div>
When I load the page, I see my body tag is adding the onload event as follows :
<body id="Body" onLoad="document.getElementById('loading').style.display = 'none';">
but the div is not disappearing after the page has loaded. Can anyone advise what I may be doing wrong here ?
Thanks