Did ASP.NET 2.0 SP1 Break Your Postbacks?
Are you using a whitespace filter maybe?
Several of the sites I work on have a white space filter implemented in them to remove white space in the html. We do this for two reasons. First, it makes the page smaller. But, more importantly, it takes gaps out of images. In some cases, we found using the white space filter was the only way to remove the gaps. We also use it as a way of injecting code on the way back to the client… think of it as a global databinding technique.
Anyhow, once you remove all the white space, you end up with code that is all on one line. This is great! Exactly what we had in mind. Except that well formed javascript has historically looked something link this:
<script lang=”javascript”>
<!–
// code goes here
// –>
</script>
So, we’ve needed to put some line feeds back in so that our javascript will run. Otherwise, you end up with javascript code that will never run. The appropriate search and replace strings to make this happen are:
newBuffer = Regex.Replace(newBuffer, “<!–”, “<!– \n” );
newBuffer = Regex.Replace(newBuffer, “// –>”, “// –> \n” );
However, once you upgrade your server to ASP.NET 3.5 or ASP.NET 2.0 Service Pack 1, this code no longer does the trick. this is because Microsoft made all of their javascript XHTML compliant, adding CDATA sections around the code rather than comments. To fix this you need to ADD the following two lines:
newBuffer = Regex.Replace(newBuffer, “//<!\\[CDATA\\[", "//<![CDATA[ \n");
newBuffer = Regex.Replace(newBuffer, "//\\]\\]>”, “//]]> \n”);
You need both sets because there may be other code that either you wrote, or third party vendors wrote that use the old format.
Other Related Items:
Floating Leaf and Debris Pond Net - 7 ft. x 10 ft.Protect your fish from predators and keep the autumn leaves out with Supreme Floating Pond Netting. Tough, durable netting floats on surface for easy set up and removal.
Sony VAIO VGP-BPL12 Extended Battery for VGN-Z5 Series (Silver)Marketing description is not available.
Gravis Filter Skate ShoesThe Filter skate shoes from Gravis









