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

后端 未结 9 1631
心在旅途
心在旅途 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 09:58

    If you do not want to make your control runat server in case you need the ID or simply don't want to add it to the viewstate,

    in the back-end:

    protected string _css = "modalBackground";
    

提交回复
热议问题