What is the use of the Visible property in case of a HiddenField?

The property Visible, as I understand it, helps to enable or disable the visibility of the control.

But what is its use in the case of a control HiddenFieldin ASP.NET?

+3
source share
3 answers

The property is Visiblepresent even on the object HiddenFielddue to inheritance .

The documentation indicates that the class HiddenFieldinherits from the base class that defines the property . Inheritance means that all classes that inherit the base class automatically receive or capture all methods exposed by the base class. In this case, it picks up the property of its base class , even despite the seeming uselessness that you indicate in the question. ControlVisibleHiddenFieldVisibleControl

This is not because languages ​​often have “stupid things” (although I will not dispute the veracity of this statement) because object-oriented design makes it impossible to remove methods from derived classes inherited from base classes.

+5
source

Visible HiddenField, . HiddenField Visible, false, . HiddenField <input type= "hidden"/>. , viewstate.

, HiddenField .Net 2.0,

, , . Visible to false viewstate <input type= "hidden"/>. , , , .

, (Visible = true) (Visible = false), .

, HiddenField , visible .

ASP.NET HiddenField

ASP.NET HiddenField wiki.ASP.NET

+5

, , .

. Unary + C ++

-4

Source: https://habr.com/ru/post/1781026/


All Articles