JavaScript in ASP.Net -


I have this code that wants to change the background color for the webpage after clicking a button for this webpage. No CSS, just a blank ASP.x page

  and ATP: Button ID = "BTN_Hang" runat = "server" text = "Change" OnClientClick = "changeBackground)" / & gt ; & Lt; Script language = "javascript" & gt; Function changebackground () {document.body.style.backgroundColor = "#eeeeee"; document.getElementById ('& lt;% = txtBox3.ClientID% & gt;'). style.backgroundColor = "# 00FF00"; } & Lt; / Script & gt;   

The problem is that the change is only on click and no longer after the click. How do I make this change permanently?

Store the fact that the change has been made continuously (such as a cookie, local storage or (An AJAXi HTTP requesting server).

On page load, test the place where you are collecting data to see if it is actually stored there or not. If so, call the function that changes.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -