Compartilhar via


How Do I learn more about the AjaxControlToolkit Controls ?

Use Debuggers to see Object State and associated methods :

Use the WebDevhelper from Nikhil Kothari which provides you with debug API to inspect Object State.

The methods available when you install the WebDevHelper are :

window.debugService.trace
You  can use this api to write messages onto the Script Trace Console.

Ex :

 if( window.debugService ) {
  window.debugService.trace("I am a trace message from the DebugService") ;
}

window.debugService.trace

window.debugService.inspect
You can use this API to inspect the state of an Object at runtime .
Ex:

 if( window.debugService ) {
window.debugService.inspect("Auto Complete Extender",$find("AutoCompleteEx"));
}

ObjectInspector

  
 How do I use these methods to help me work with the AjaxControlToolkit Controls?
Whenever you want to work on the AjaxControlToolkit controls , there are a couple of things that hinder you
  1.  You don't know which methods are available on an extender 
    
  2.  You don't know how to invoke those methods on the extender
    
 1) You don't know which methods are available on the Extender : 
 a) Get a handle to the Behavior of the Extender using the $find Method.
ex : 
 var autoCompleteBehavior = $find("AutoCompleteEx");
  b) Use an Object Explorer to view the methods exposed by it :
  In Web Dev Helper's Script Console  : 
      window.debugService.inspect("AutoComplete Extender",autoCompleteBehavior);
        Using the ASP.NET AJAX API  : 
          Sys.Debug.traceDump(object, name) 
          Dumps an object to the debugger console and to the TraceConsoletextarea element, if available.
   Sys.Debug.traceDump("AutoComplete Extender",autoCompleteBehavior);
  2) You don't know how to invoke those methods on the extender
    In general , you can have a general rule about how to invoke these methods :
      The general syntax would be :
     <ExtenderBehaviorHandle>.<MethodName>([Params])
     ex : 
     autoCompleteBehavior.set_firstRowSelected(true)
  
 And finally :
 The best way to know which methods are exposed and what are the parameters exposed by the extender 
is to Read the Source Code .
 Download the Latest Release Source Code from Here
 Hope this helps.
If you have a question about a specific Extender , feel free to drop a comment or contact me .

Comments