开发者

Why only specific controls are inherited from IPostBackDataHandler Interface in asp.net

开发者 https://www.devze.com 2023-01-02 08:24 出处:网络
Please tell me why some specific controls are inherited from IPostBackDataHandler interface (which maintains their state using HTTP Post header). and if state of controls like textbox are maintained b

Please tell me why some specific controls are inherited from IPostBackDataHandler interface (which maintains their state using HTTP Post header). and if state of controls like textbox are maintained by HTTP post headers then开发者_运维百科 why they have property "View state" and what is use of it?.


IPostBackDataHandler is used by input controls mostly, to access the POST data they generate. Controls such as labels don't generate any POST data keys of their own, so they don't use it.

Controls such as the TextBox use the view state to store things other than their value (enabled or not, maximum length, width, all the style properties, etc). Also, they use the viewstate to store their value when the control itself is invisible or otherwise not successful and its value will not get sent back by the browser.

0

精彩评论

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