ASP.NET Ajax & DNN compression issues… a community contribution workaround

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

One interesting thing. I had many mails and forum posts in relation with my Ajax & DNN integration project.

Till recently all these mails and support were one way, until Mr. Ed Vinyard contacted me.

His first email had this:

…So far, I have only had success with ASP.NET AJAX partial updates by disabling whitespace compression in Compression.config. How did you get AJAX to work without altering this setting? I believe I’ve following your instructions very carefully — but I could be wrong.

It appears that the whitespace compression alters the content length in each update panel section, throwing off the content length counts, and making the response unusable. This results in the infamous
“Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed…”…

I had the same problem for a while, but just didn’t get around to dig into it a little deeper.

So after a conversation with Ed, he had sent an email with the solution for the compression problem he found. It goes like this:

…Since I first wrote you, we’ve found an alternate workaround for this.

Compression and the whitespace filter can remain enabled if you exclude the “text/plain” response MIME type from compression. This works because the response type for partial updates is “text/plain”.

I say “alternate” because it may be worse than disabling the whitespace filter — maybe much worse in a heavily AJAX-ified site. We haven’t made any comparative measurements of response sizes.

For the time being, we’ll be disabling whitespace filtering for production use. We might be digging around in the HttpCompress code soon, though.

Again, thank you for the article. It would’ve taken me much longer to get ASP.NET AJAX code working on DNN without it….


You might be asking yourself why I am so glad, and am posting this in this manner?

There are 2 great reasons:

1) I am really happy someone else digged into this and found at least a partial solution
2) It sounds VERY nice to get some ideas back from people who are using something you’ve released

So thank you Ed.

So if you have compression problems with DNN, this should help you a bit.


Cheers!



Filed under: .NET, ASP.NET, Ajax, DotNetNuke
Written on: 28 Mar 2007 ·

kick it on DotNetKicks.com

Leave a Reply