开发者

controls that have visible set to false

开发者 https://www.devze.com 2023-02-10 16:26 出处:网络
If I have a grid, and it is binded to some data, but the visible=false for the grid, will it consume any resources for initializations or for retrieving data to perform the bindings?

If I have a grid, and it is binded to some data, but the visible=false for the grid, will it consume any resources for initializations or for retrieving data to perform the bindings?

How about if 开发者_JS百科the grid is inside a div, and the div visible=false


It will consume server resources for initializations and retrieving data but will not be rendered. so in html it will not be included.

In case of div there are two scenarios

If div runat='server'

then same as above

otherwise if div is not set to runat server

then it will also be rendered and will be included in html but will be hidden i.e. because of visibility = false


If you set Visible to false, ASP.NET doesn't generate any markup code for the control. However, having Visible set to false doesn't really mean that no path in the control's code can output text. The control is still an active object that exposes methods and handles events. If a method, or an event handler, sends text directly to the output console through Response.Write, this text will be displayed to the user anyway. A control with the Visible attribute set to false is still part of the page and maintains its position in the control tree.

So, it will consume all resources for initializations or for retrieving data to perform the bindings. Obviously, the same for grid inside div.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号