Button background colour

前端 未结 6 1472

I need to change the background colour of a button using C# code (Visual Studio 2008).

I saw some people recommending the inclusion of a directive: us

6条回答
  •  再見小時候
    2021-01-21 12:42

    On PageLoad try this,

    Button1.Style.Add("background-color", "green");

    Use a method to write a condition when you want to change the color of the button. if condition is true use above code to change the color of the button as you prefer.

提交回复
热议问题