Initialize error

Last post 09-03-2009, 2:59 PM by ccrook. 8 replies.
Sort Posts: Previous Next
  •  09-01-2009, 2:09 PM 55261

    Initialize error

     I have tried implementing the AjaxUploader in our project, but when clicking the "Add Files" button, it hangs forever and I get the following error:
    Error: CuteWebUI_AjaxUploader_Initialize is not defined
    Source File: BLOCKED SCRIPTalert('TODO: FIXME')
    Line: 0
     
    I have added the following keys into the web.config
    <system.webServer>
            <modules>
                <add name="CuteWebUI.UploadModule" type="CuteWebUI.UploadModule,CuteWebUI.AjaxUploader"/>
                <add name="MagicAjaxModule" type="MagicAjax.MagicAjaxModule, MagicAjax"/>
            </modules>
    </system.webServer>
    Filed under:
  •  09-01-2009, 8:19 PM 55268 in reply to 55261

    Re: Initialize error

    Hi,
     
    Are you using IIS7 integrated mode ?
     
    if not , please also make sure you add them to <system.web/> (not system.webServer):
     
    <system.web>
     <httpModules>
         <add name="CuteWebUI.UploadModule" type="CuteWebUI.UploadModule,CuteWebUI.AjaxUploader" />
     </httpModules>
     </system.web>
     
    Regards,
    Terry
  •  09-02-2009, 8:09 AM 55291 in reply to 55268

    Re: Initialize error

    Yes, we are.  But I've also tried adding that key as well.   In fact, I have tried them both together and separately.
     
     I'm a little frustrated right now after convincing my boss to purchase a development  team license and not being able to implement your software.
     
    The  "BLOCKED SCRIPTalert('TODO:FIXME')" is not filling me with a lot of confidence.
     
    (btw, BLOCKED SCRIPT = j_a_v_a_s_c_r_i_p_t)
  •  09-02-2009, 8:52 AM 55295 in reply to 55291

    Re: Initialize error

    Hi,
     
    That code is modified by this forums..
     
    --
     
    So can you open this URL ?? 
     
     
    (change the 'appname' to your testing website)
     
    Or this :
     
     
    Regards,
    Terry
  •  09-02-2009, 11:14 AM 55303 in reply to 55295

    Re: Initialize error

    Well, that has provided somewhat of a hint as to what is happening.
     
    Trying both of those resources caused an error in my transaction scope handling.  In the Global.asax file's Application_BeginRequest I open an object to handle the transactions to the database and close the object in the Application_EndRequest.  So either the call to your resource never calls the BeginRequest or calls the EndRequest more than once.  
     
    I added a catch around the closing of my object, and received these two messages:
     
    var OxOedfe=["{0} cannot be uploaded!\x0A\x0 ...
    var OxOedfe=["{0} cannot be uploaded!\x0A\x0AFile ...

    I feel uncomfortable leaving that catch in there as a long term solution. Could you check your code to verify that any BeginRequest calls are mirrored by an EndRequest and vice versa.
  •  09-02-2009, 8:21 PM 55323 in reply to 55303

    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
  •  09-03-2009, 9:01 AM 55348 in reply to 55323

    Re: Initialize error

    I do know how to handle the error; however, that does not solve the problem.
     
    Your code interrupts the  normal Application Life Cycle and it should make sure the normal life cycle is at least initialized.  Also, you should document the fact that you are doing so.
  •  09-03-2009, 9:28 AM 55349 in reply to 55348

    Re: Initialize error

    Hi,
     
    You can specify this :
     
    <add key="CuteWebUI.AjaxUploader.AllowSession" value="True" />
     
    To make the 'asp.net life cycle' better.
     
    Regards,
    Terry
  •  09-03-2009, 2:59 PM 55362 in reply to 55349

    Re: Initialize error

    I've added the key, but it did not fix the problem.    I do have a workaround, so it is no longer a blocking issue in using your control, but I would still like it to "play nicely" with the normal life cycle.
View as RSS news feed in XML