Welcome to EMC Consulting Blogs Sign in | Join | Help

steven evans

MS AJAX UpdatePanels and ISA Server

The project that I am currently on is making use of MS AJAX UpdatePanels on quite a number of the pages and in one particular case some of the content returned to the client in this partial page postback scenario contains a link/href to some other page. Depending upon whether the user is accessing the site internally (from within the corporate network) or via the internet means that the link needs to be tailored  for that specific scenario.

What this means is that they use their ISA Server to perform Link Translations to provide this tailored link. Now this all works fine for pages that are rendering the link/href in page without using partial page postback but NOT in the case of the content returned by the UpdatePanel. So after much head scratching - I know close to absolutely nothing about ISA Server - we realised that the content being returned by the partial page post back was not being link transformed because the content-type (use fiddler to see he response sent to the client when causing a postback in an UpdatePanel) was not set up for the Enterprise/Array within ISA Server.

What you get sent back for a request made in an UpdatePanel is content-type : text/plain and in our case the ISA Server was only set to Link Translate on text/html and some other content-types but not text/plain. So, simply a case of setting it to use text/plain then? Well yes and no. What we quickly saw was that by setting the entire array (this is an ISA Server term that I can’t actually claim to really understand) to use content-type text/plain that our link did indeed get link translated however, the result of this is that we then got a Sys.WebForms.PageRequestManagerParserErrorException error.

The reason that we get this parse error is widely documented but in short, when using UpdatePanels the content-length attribute in the response header is used in order to extract the content from the response such that the necessary parts of the DOM can be updated. In our case the link translations caused the length on the actual content to be larger than the reported content-length in the header and so we get the parse error.

Published 08 April 2009 10:38 by steven.evans

Comments

 

fir3pho3nixx said:

Hi there, why are you using UpdatePanels? Was this something you were forced to do? Have you seen JQuery? and/or considered switching to an MVC framework? The performance gains are worlds apart ....

April 9, 2009 10:27
 

steven.evans said:

The reason that we are, or rather were using UpdatePanels is that at the time we started the project, well in excess of a year ago, we could not use the MS MVC framework as it was still in beta - our client does not permit the use of beta software in their applications so therefore our choice was somewhat constrained. I suppose we could have used another MVC framework but it was decided that we'd still go the web forms route. Additionally, our client predominantly supports only MS technologies and so use of jQuery would also have been problematic.

I don't think that the use of web forms (although very much frowned upon these days) in conjunction with UpdatePanels necessarily means that the page will perform badly. Used judisciously, I think both are not necessarily evil.

April 9, 2009 10:55
 

fir3pho3nixx said:

That is cool, I do think however JQuery is a proven framework for javascript and outstrips the likes of scriptaculous and microsoft's very own Ajax when it comes to memory leaks and performance.

You might be very good at what you do, so I will assume your work is world class, but lets say perhaps that from what I have seen out there as a contractor you are 1 in 100 000. So for every good solution you deliver there are another 100 000 that I am out there repairing/rewriting! :D MSAjax in the hands of a novice is like America giving South Korea more nukes!

April 9, 2009 12:11
Anonymous comments are disabled
Powered by Community Server (Personal Edition), by Telligent Systems