Question regarding Visible=false and display:none;

前端 未结 4 1484
挽巷
挽巷 2021-01-18 08:19

If I set some control\'s property Visible=\"false\", I cant see the control in the HTML generated of my aspx page. But when I use display:none in style tag for that control,

4条回答
  •  独厮守ぢ
    2021-01-18 08:36

    I think the important difference lies in whether you need access to the items inside the panels, client-side. Setting visible=false will cause the panel not to be rendered, so you can't get at any of the controls, once again, client-side. Whereas if you set display none, then you will have access to the controls, as the panel is rendered.one more concern about visible=false avoid validation.

提交回复
热议问题