In the Ajaxhandlerfactory GetHandler method, you will eventually create a actionhandler, which is a httphandler, which will be called in the 15th step of the pipeline (referencing the blog "Write your own service framework with ASP." In the order).
Note: The GetHandler method of Ajaxhandlerfactory is called in the 10th step, and the 12th step is to prepare the session (non-in-process mode), so you must decide how to use the session before the 12th step.
All action codes are executed in Actionhandler:
Internal class actionhandler:ihttphandler{ internal Invokeinfo invokeinfo; public void ProcessRequest (HttpContext context) { //Call the Core tool class, execute action actionexecutor.executeaction ( Context, this. invokeinfo); }
The ExecuteAction implementation process is as follows:
internal static void ExecuteAction (HttpContext context, Invokeinfo Vkinfo) {if (context = = null) throw new Argu Mentnullexception ("context"); if (Vkinfo = = null) throw new ArgumentNullException ("Vkinfo"); Call Method Object result = executeactioninternal (context, vkinfo); Set OutputCache Outputcacheattribute OutputCache = vkinfo.getoutputcachesetting (); if (OutputCache! = null) Outputcache.setresponsecache (context); The return result of the processing method Iactionresult Executeresult = result as Iactionresult; if (Executeresult! = null) {executeresult.ouput (context); } else {if (result! = NULL) {//plain type result context. Response.ContentType = "Text/plain"; Context. Response.Write (Result. ToString ()); }}}internal Static Object Executeactioninternal (HttpContext context, Invokeinfo Info) {//Prepare parameters to be passed to the calling method object[] Parameters = Getactioncallparameters (context, info. Action); Call the method if (info. Action.Hasreturn) return info. Action.MethodInfo.Invoke (info. Instance, parameters); else {info. Action.MethodInfo.Invoke (info. Instance, parameters); return null; }}
Before I did not say the time to call Setresponsecache (), this time is here: after executing the action.
Once the outputcache has been set, the return value is processed.
In the previous code, there was an important call:
Prepare parameters to be passed to the calling method object[] Parameters = getactioncallparameters (context, info. Action);
"Recommended"
1. Special recommendation : "PHP Programmer Toolkit" V0.1 version download
2. asp free Video Tutorial
3. an entry-level. NET MVC Instance
4. MYMVC The process of finding action in the box
5. the. NET MYMVC Framework processes the return value tutorial
6. the. NET MYMVC Framework How to assign values to a method tutorial