0

我正在使用它设置某些控件

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

我如何检查另一种方法中的值是什么?

我想是这样的:

if (divCorporateId.Style........ == "hidden")
{
    do something
}
4

2 回答 2

2

就像是:

if (divCorporateId.Style[HtmlTextWriterStyle.Visibility] == "hidden")
{
    do something
}
于 2013-03-01T10:32:03.227 回答
1

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.

于 2013-03-01T10:33:44.813 回答