ASP.NET управляет с CSS visibility:hidden, не будучи показанным на Управлении. Видимый = верный

Вы могли бы найти эту метастатью несчастья интересной как стартовая точка:

http://furiouspurpose.blogspot.com/2008/07/command-line-parsing-libraries-for-java.html

6
задан Fermin 23 September 2016 в 08:37
поделиться

3 ответа

The Visible property affects rendering of the entire element and is unrelated to the CSS visibility attribute. When false, Visible when prevent any HTML from being rendered at all.

To change the css attribute, you will need to do it manually. You can do this by either removing the "error" class from the element (via the CssClass property) or by setting a style="visibility: visible" attribute manually via the Attributes property (since the style attribute overrides a css class):

control.Attributes["style"] = "visibility: visible";
14
ответ дан 8 December 2019 в 03:27
поделиться

You are getting confused between CSS visibility and the control's server side Visible property. To understand it better I recommend you create a sample page with a label, toggle the Visible property between true and false and view the generated HTML.

What you will find is as follows. As true:

<div>
   <label runat="server" visible="true">Hello</label>
</div>

Will render:

<div>
    <label>Hello</label>
</div>

When set to false, it will render:

<div>

</div>
12
ответ дан 8 December 2019 в 03:27
поделиться

Have a look at this page, it should clarify things: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol.style.aspx

Как было написано ранее:

Свойство Visible является серверным и определяет, Сервер будет отображать элемент управления или нет (если он не визуализирован, для него не будет создан HTML-код и его нет в окончательной отправке HTML-кода клиенту).

Свойство Style управляет атрибутом стиля элемента. Элемент будет отображаться, но вы можете управлять видимостью (CSS).

3
ответ дан 8 December 2019 в 03:27
поделиться
Другие вопросы по тегам:

Похожие вопросы: