How to edit CSS style of a div using C# in .NET

后端 未结 9 1643
心在旅途
心在旅途 2020-12-03 09:26

I\'m trying to grab a div\'s ID in the code behind (C#) and set some css on it. Can I grab it from the DOM or do I have to use some kind of control?

9条回答
  •  广开言路
    2020-12-03 10:23

    To expand on Peri's post & why we may not want to use viewstate the following code:

    style="<%= _myCSS %>"

    Protected _myCSS As String = "display: none"
    Is the approach to look at if you're using AJAX, it allows for manipulating the display via asp.net back end code rather than jquery/jscript.

提交回复
热议问题