Find a control style in C#

前端 未结 2 1224
清歌不尽
清歌不尽 2021-01-27 19:49

I am setting certain controls using this

divCorporateId.Style.Add(\"Visibility\", \"hidden\");

How do i check what the value is in another meth

相关标签:
2条回答
  • 2021-01-27 20:04

    Something like:

    if (divCorporateId.Style[HtmlTextWriterStyle.Visibility] == "hidden")
    {
        do something
    }
    
    0 讨论(0)
  • 2021-01-27 20:09

    You can get Css property value in C# like this

    string value = divCorporateId.Style["Key"]
    

    then you can apply your conditions based on this value.

    0 讨论(0)
提交回复
热议问题