Re: Initialize error

  •  09-02-2009, 8:21 PM

    Re: Initialize error

    Hi,
     
    The UploadModule use Asp.Net Async BeginRequest event,
     
    And the code run before your Application_BeginRequest,
     
    After the resource sent, (either the Response.End() or Application.CompleteRequest() will execute)
     
    So your Application_BeginRequest will not call , but Application_EndRequest will call.
     
    I suggest you do this way :
     
    Application_BeginRequest (..)
    {
      context.Items["MyTransaction"]=true;
    }
    Application_EndRequest(..)
    {
      if(true.Equals(context.Items["MyTransaction"]))
      {
          //dispose the objects..
      }
    }
     
     
    Regards,
    Terry
View Complete Thread