2008年7月20日 星期日

[筆記]AJAX .Net 中 UpdatePanel 的限制

其實不是第一次被問了,每次都要查一下資料
還是特別筆記一下好了

參考資料:http://msdn.microsoft.com/en-us/library/bb386454.aspx

Controls that Are Not Compatible with UpdatePanel Controls

The following ASP.NET controls are not compatible with partial-page updates, and are therefore not designed to work inside an UpdatePanel control:

  • TreeView control under several conditions. One is when callbacks are enabled that are not part of an asynchronous postback. Another is when you set styles directly as control properties instead of implicitly styling the control by using a reference to CSS styles. Another is when the EnableClientScript property is false (the default is true). Another is if you change the value of the EnableClientScript property between asynchronous postbacks. For more information, see TreeView Web Server Control Overview.

  • Menu control when you set styles directly as control properties instead of implicitly styling the control by using a reference to CSS styles. For more information, see Menu Control Overview.

  • FileUpload and HtmlInputFile controls when they are used to upload files as part of an asynchronous postback.

  • GridView and DetailsView controls when their EnableSortingAndPagingCallbacks property is set to true. The default is false.

  • Login, PasswordRecovery, ChangePassword, and CreateUserWizard controls whose contents have not been converted to editable templates.

  • The Substitution control.

To use a FileUpload or HtmlInputFile control inside an UpdatePanel control, set the postback control that submits the file to be a PostBackTrigger control for the panel. The FileUpload and HtmlInputFile control can be used only in postback scenarios.


如上所述,部份物件是無法在 UpdatePanel 中使用的,必須用 PostBack的方式才能完全完整的動作,而部份元件必須有條件的才能使用 AsyncPostBack 的功能,使用時請小心

0 回應:

 
TEMPLATE HACKS AND TWEAKS BY [ METAMUSE ] BLACKCAT 1.1