views:

1091

answers:

2

I have a custom user control that i use in a page in Umbraco CMS... since upgrading to version 4, it seems this user control wont work any longer.

The user control contains an ajax uploader control (support request post here: http://cutesoft.net/forums/53732/ShowThread.aspx#53732), which allows users to upload images, then displays the uploaded images to the user. The control and image displays are contained within an UpdatePanel, which is where this problem is - seems the data getting sent back to the updatePanel is not valid, so the client is spitting the dummy and throwing this error:

Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near '

<!DOCTYPE html PUBL'.

I think its somethihng to do with how Master Pages is implemented in Umbraco v4 that is causing this. Any ideas as to why this may have happened, and what i can look at to try to solve it?

FYI, here's a blog post that describes the error and its possible causes: http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx

i'm doing any Response.write or Response.Redirect in the updatePanel I'm not using any response filters I've disabled server trace I'm not using response.transfer

But, regardless of the above, this works fine using the same usercontrol on an Umbraco v3 site, which leads me to believe its somethign to do with v4 that's caused this.

Any suggestions greatly appreciated

+1  A: 
Sander
Thanks heaps for this Sander... I would love to change over to a simpler, more elegant jQuery solution, however there is no money in this for me, and its not just a straight swap-over, because:1. My form needs to allow users to upload between 1 and 3 images2. It must show a progress bar (images might be large)If you think it'll be easy to extend this example to meet my needs, i'll certainly look into it further... but i was hoping to just find the problem with my current solution and fix it.CheersGreg
Gregorius
A: 

Pfew,..That's a lot of code.

I was only interessted in saving media in Umbraco but it's nice to see a jQuery upload too.

What upload jQuery lib your using? I've found serveral.

You could make the code a bit simpler by using Path.Combine, FileInfo.Extension merging if's and a few extra variables here an there. But hey I've got Resharper to make my live easier.