This project has moved. For the latest updates, please go here.

ASP.NET HttpHandler + SSL + ErrorOccurred Javascript event not working

Jun 11, 2012 at 11:40 AM

Hi,

I'm currently utilising the javascript events with the single file uploader and an ASP.NET .ashx HttpHandler. The code works well with your javascript ErrorOccurred event firing nicely when I raise an exception within the HttpHandler server side. This allows me to redirect, client side, to another error handling page.

However, when I test the site (IE9, Firefox 12) with SSL enables all works well except the ErrorOccurred event now fails to fire?

I've browsed your site for your SSL recommendations but have found that they all refer to using a WCF service and are therefore not helpfull in my situation as I am using an HttpHandler.

Can you provide any help so as I can find a solution to this problem.

Any help appreciated, thanks for a great component otherwise.

 

Coordinator
Jun 11, 2012 at 11:45 AM

Hi,

Is it only the ErrorOccured event that stopped working under SSL?
Can you try the included JavaScriptSample page with SSL so you can see if the other events are working.

Hope this helps to locate the problem.

Michiel

 

Jun 11, 2012 at 1:16 PM

Thanks for quick reply and direction, I've used your sample page to try to locate the error and this has highlighted that this is not an SSL problem as your page error trap works, sorry about that! The problem lies with:

<customErrors mode="On" redirectMode="ResponseRedirect" defaultRedirect="~/Account/Exception.aspx">

if I use:

<customErrors mode="Off" redirectMode="ResponseRedirect" defaultRedirect="~/Account/Exception.aspx">

the problem goes away - obviously.

I now realise I need to treat this HttpHandler error diferently to normal site errors as the upload page is getting confused as it is both trying to redirect to a specific upload error page from the uploader client code whilst also trying to redirect to the standard error page as invokded from the server side error trapping, which also explains why the page was not redirecting anywhere at all!

If you have a pearl of wisdom regards this then I would appreciate that otherwise I'll plough on and see what I can come up with.

Thanks very much - it's a quaility component.

 

 
 

 
Jun 11, 2012 at 1:28 PM

Thinking further on this, rather than throwing an exception in the handler what HTTP response will your silverlight component receive and interpret as an error?

Coordinator
Jun 11, 2012 at 3:26 PM

Silverlight in the browser always receives errors as 404 not found. No matter what error you throw on the server, Silveright sees a 404.