HiddenField is not a WebControl?

Why System.Web.UI.WebControls.HiddenFieldinherit System.Web.UI.Controlinstead System.Web.UI.WebControls.WebControl? This seems like a really illogical placement, if not the fact that hidden fields are used on web pages. What is the reason it was developed?

It is annoying when you cannot do things like WebControl x = new HiddenField();

+5
source share
1 answer

The main difference between UI.Controland UI.WebControls.WebControlis that it is WebControlintended to be used as a base class for a component with a UI. Since a hidden field never displays anything to the user (it is still hidden), it UI.Controlis a more suitable base class.

+5
source

All Articles