This is a migrated thread and some comments may be shown as answers.

Custom Handler scenario throwing an error

6 Answers 174 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
1zias01
Top achievements
Rank 2
1zias01 asked on 27 Feb 2011, 11:23 PM
I implemented a basic custom handler similar to the  Custom Handler demo on this page:

http://demos.telerik.com/aspnet-ajax/upload/examples/async/imageuploader/defaultcs.aspx?product=asyncupload

However every time I try to upload a file the visual studio debugger pops up a couple different client errors and takes me a spot in the telerik.web.ui.webresoure_2.axd  dynamic file to a specific line:

if(!e){throw"Error while uploading, "+i;

The pop error messages are:

Microsoft JScript runtime error: Unhandled Error in Silverlight Application The remote server returned an error: NotFound.   at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
   at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at UploadPrototype.MainPage.ProcessResponse(IAsyncResult asyncResult)
   at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClassd.<InvokeGetResponseCallback>b__b(Object state2)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

AND

Microsoft JScript runtime error: Unhandled Error in Silverlight Application Failed to Invoke: _onSilverlightError.   at System.Windows.Browser.ScriptObject.Invoke(String name, Object[] args)
   at UploadPrototype.EventManager.SilverlightError(String message, Int32 index)
   at UploadPrototype.MainPage.<>c__DisplayClass1f.<ProcessResponse>b__18()


Some help please.

6 Answers, 1 is accepted

Sort by
0
Accepted
Genady Sergeev
Telerik team
answered on 01 Mar 2011, 03:05 PM
Hello Chris Zias,

Can you please post your handler declaration as well as the RadAsyncUpload markup so that we can take a look. Also, which version of telerik do you use?

Regards,
Genady Sergeev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
1zias01
Top achievements
Rank 2
answered on 01 Mar 2011, 06:30 PM
Sorry I found the answer in another post.  My .ashx was not compiling corectly.  The namespace was not correct.  But it works now thanks!
0
Anas
Top achievements
Rank 1
answered on 23 Jan 2012, 12:23 PM

Hi

I'm getting this same error.
I've added the following handler to the web.config:

<add name="Telerik.Web.UI.WebResource.axd" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode" /> 

 

The RadAsyncUpload markup I'm using is:

<telerik:RadAsyncUpload ID="tlrkRadAsyncUpload1" runat="server" InitialFileInputsCount="1" MaxFileSize="524288000" OnClientFileUploadFailed="onUploadFailed" /> 
 

 And I'm not using a custom handler.

Thanks
0
Derrick
Top achievements
Rank 1
answered on 08 Mar 2012, 10:44 PM
I have my own HTTP handler which is interfering with the Telerik handlers.

Here is my handler configuration section from my web.config:

    <httpModules>
        <add type="MetroLinx.Web.MetroLinxHttpModule" name="MetroLinxHttpModule" /> 
    </httpModules>
    <httpHandlers>
       <add verb="*" path="*js.axd" type="MetroLinx.Web.MetroLinxHttpHandler" /> 
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
      <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
      <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
      <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
      <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />

    </httpHandlers>

What can I change so my handler will work side by side with Telerik's handlers?
0
Genady Sergeev
Telerik team
answered on 13 Mar 2012, 01:05 PM
Hello Derrick,

Please move your handler declaration after the declaration of the telerik handlers. This is needed because you have * in the path for your handler. This means that it will gather all requests for .axd files, including ones that are for the Telerik handlers.

Moving its declaration at the end will force asp.net to try to match the request to one of our handlers first, and only if there is no mach, forward it to your custom handler.

Greetings,
Genady Sergeev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Derrick
Top achievements
Rank 1
answered on 13 Mar 2012, 01:11 PM
Thanks.  Will try that too.

I did find a way of getting this to work be doing the following:

Replacing the Telerik Script Manager and update panels with the regular AJAX script manager and update panels included with the AJAX control toolkit for ASP.NET 4.0.

I also removed the Telerik AJAX RAD manager control.
Tags
AsyncUpload
Asked by
1zias01
Top achievements
Rank 2
Answers by
Genady Sergeev
Telerik team
1zias01
Top achievements
Rank 2
Anas
Top achievements
Rank 1
Derrick
Top achievements
Rank 1
Share this question
or