Change page color while reloading

protected void Page_Load(object sender, System.EventArgs e)
{
 ClientScriptManager ColorPageOnUnload = Page.ClientScript;
 ColorPageOnUnload.RegisterClientScriptBlock(ColorPageOnUnload.GetType, "ColorPageOnUnload", "window.onbeforeunload = ColorPageOnUnload; function ColorPageOnUnload(){document.body.style.backgroundColor = 'Gray'; document.body.style.opacity = 0.5;}", true);
}

No comments:

Post a Comment