Tips and tricks for .NET using ASP and VB code.

Change page color while reloading

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim ColorPageOnUnload As ClientScriptManager = Page.ClientScript ColorPageOnUnload.RegisterClientScriptBlock(ColorPageOnUnload.GetType, "ColorPageOnUnload", _ "window.onbeforeunload = ColorPageOnUnload; function ColorPageOnUnload(){document.body.style.backgroundColor = 'Gray'; document.body.style.opacity = 0.5;}", True)
End Sub

No comments:

Post a Comment

Search This Blog