30 likes | 232 Views
Asp.net Ajax Video. http://www.asp.net/learn/ajax-videos/. notes. Get Started with ASP.NET AJAX. Microsoft Ajax – extension, can be downloaded from asp.net site. Every web page uses Microsoft Ajax must have one and only one instance of ScriptManager .
E N D
Asp.net Ajax Video • http://www.asp.net/learn/ajax-videos/ notes
Get Started with ASP.NET AJAX • Microsoft Ajax – extension, can be downloaded from asp.net site. • Every web page uses Microsoft Ajax must have one and only one instance of ScriptManager. • UpdatePanel updates only it own content • UpdatePanels use for partial page update pattern • UpdatePanel has ContentTemplate where we can place content • UpdatePanel has Triggers where we can declare our own triggers • AsyncPostBackTrigger has ControlID property – for handling specific control, and EventName Property – for handling specific event • Default behaivor of UpdatePanel – when one UpdatePanel updated – all UpdatedPanel updated too. • UpdatePanel has property – UpdateMode • UpdateMode:Always – update all UpdatePanels • UpdateMode:Condition – update only by condition • sample code - 01-Introduction
Client side network callback with ASP.NET AJAX • ScriptManager has templates for WebServices – Services • You can add referense to webservice, adding ServiceReference to Services template • ServiceReference has property Path – where you can set path to services • If services in same solution (in the same web site) you have to set Path to asmx file, webservice have to located on same domain as a page. • You can call webservice method from javascript using syntax: namesapce.classname.Method(parameters, onsuccess, onfailure) • You have to decorate webservice class with System.Web.Script.Services.ScriptService attribute • When you invoke webservice method you have to set additional properties: callback javascript function like OnSuccess, OnFailure • In all callback function webservice proxy set “args” parameters • InlineScript – copied proxy classes to page when it rendered. • EnablePageMethods attribute of ScriptManager allows to call static methods of web page from javascript • Static pages method have to decorated by WebMethodAttributes • You can call static page methods from javascript using syntax: PageMethods.MethodName(params, onsuccess, onfailure) • Info - http://msdn.microsoft.com/ru-ru/library/bb398998.aspx • sample code - 02-ClientServerIteractions