AJAX ASP.NET AJAX ASP.NET MIS 424 Professor Sandvig Professor Sandvig
Jan 06, 2016
AJAX ASP.NETAJAX ASP.NETMIS 424
Professor SandvigProfessor Sandvig
TodayToday
1.1. ASP.NET AJAXASP.NET AJAX
2.2. Controls: built-in propertiesControls: built-in properties
3.3. ScriptManager, UpdatePanelScriptManager, UpdatePanel
ASP.NET 2.0 AJAXASP.NET 2.0 AJAX
ASP.NET provides built-in AJAX ASP.NET provides built-in AJAX functionalityfunctionality
Two flavors:Two flavors: Built into some Data ControlsBuilt into some Data Controls
LimitationsLimitations ScriptManager & Update PanelScriptManager & Update Panel
Very flexibleVery flexible
Server ControlsServer Controls
Built in AJAX functionalityBuilt in AJAX functionality GridView, DetailsView, FormViewGridView, DetailsView, FormView
Property: AllowSortingAndPagingCallbacksProperty: AllowSortingAndPagingCallbacks
BenefitsBenefits Easy to implementEasy to implement
Limitations:Limitations: Controls cannot use templatesControls cannot use templates Inefficient: retrieves all data and discards extraInefficient: retrieves all data and discards extra
UpdatePanelUpdatePanel
UpdatePanelUpdatePanel Wrap any server controlsWrap any server controls Become AJAX enabledBecome AJAX enabled
BenefitsBenefits Easy to implementEasy to implement FlexibilityFlexibility
Mix & match controlsMix & match controls
Specify triggersSpecify triggers
Update PanelUpdate Panel
DisadvantageDisadvantage JavaScript cannot be tweakedJavaScript cannot be tweaked
Fine if it meets your needsFine if it meets your needs HeavyHeavy
All controls are repopulatedAll controls are repopulated
Viewstate also sent/receivedViewstate also sent/received
Example:Example: Cascading Dropdown:Cascading Dropdown:
CarParts.comCarParts.com
AjaxAspNet.aspxAjaxAspNet.aspx
AJAX ToolkitAJAX Toolkit
Ajax ToolkitAjax Toolkit Includes several prewritten AJAX & Includes several prewritten AJAX &
JavaScript scriptsJavaScript scripts
SummarySummary
ASP.NET AjaxASP.NET Ajax1.1. Built into some controlsBuilt into some controls
• Sorting and pagingSorting and paging
2.2. Update Panel will “Ajaxify” all controlsUpdate Panel will “Ajaxify” all controls
3.3. Ajax toolkitAjax toolkit• Drag-and-drop AJAX controlsDrag-and-drop AJAX controls
Benefit: Benefit: ConvenienceConvenience FlexibilityFlexibility
Disadvantage:Disadvantage: Inefficient use of bandwidth (speed)Inefficient use of bandwidth (speed)