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.

  • VS 2008 + SP1 + Vista + Hot Fix KB951618 = 6 x VS Crash in 2 hours

    A couple of weekends ago I decided to bite the bullet and install SP1 for Visual Studio 2008. The whole affair was less painful than I expected and initially I was very pleased with the difference it seemed to have made to the sprightliness of the IDE. This short found happiness lasted for just one or two days and then the annoyance of Visual Studio crashing five or six times every couple of hours or so quickly replaced it.


    After just putting up with it for a couple of days I could take it no more and started moaning like a child that’s dropped their ice cream in the mud to my colleagues. One of them asked if I had installed any other updates recently and so I had a look at which windows updates had been installed and this revealed:

    •    KB905866
    •    KB951618

    So I had a look at what these updates were for and found that the first (KB905866) is a junk email filter update – an unlikely candidate I thought. The second (KB951618) is something to do with Onekey recovery – again doesn’t sound a likely culprit.

    As these were the only updates that had been installed since I had installed SP1 I decided to uninstall them, and to this very day I have not had a single crash from Visual Studio. Now this may just be coincidence and I could be doing a disservice to some very worthwhile hot fixes here, all I know is that my dev environment was crashing with such frequency as to considerably reduce my productivity and now its not, so if anybody else is encountering the same issue it may be the same thing..??

  • ASP.Net features of Web Development Helper

    Introduction

    I've used Nikhil's Web Developer Helper a number of times in the past for looking at what is sent back and forth across the wire, but until recently I had never bothered using the features on the ASP.Net menu. This was partly because I had never had the need and because I had never actually found out how to get that menu enabled. About a week or so ago I wanted a way to look at the contents of the view state for a page and so decided to work out how to do so using the Web Development Helper view state features. So I spent all of about 15 minutes googling to try and find out, asked my colleagues and nobody seemed to know – some remembered using those features in the past but not how to get them enabled. As it happened I just stumbled across the answer in the 'Pro ASP.NET 3.5 in C# 2008' book so thought I'd post the details just in case anybody else was foiled like I was.

    Enabling Asp.Net Menu

    It turns out that getting these features in enabled is really rather straight forward and probably very clearly documented in some read me file or something that I clearly just didn't bother reading, but anyway here we go:

    1. In the web site that you wish to examine add a reference to nStuff.WebDevHelper.Server.dll (an assembly that would have been installed when you installed the web development helper). In my case it was installed to C:\Program Files\nStuff\Web Development Helper.
    2. Modify the web.config and add the following entry to the httpModules section:

      <add name="DevInfo" type="nStuff.WebDevHelper.Server.DevInfoModule, nStuff.WebDevHelper.Server" />

    And that's it, in theory now you should be able to see all of te asp.net menu features enabled. That said, if you are using ASP.Net 3.5 you may not be able to see the decoded view state. I'm not 100% on this, but on the project I'm working on (ASP.Net 3.5) when I try to examine a decoded version of the viewstate in both the Web Development Helper (version 0.8.5.1) and Asp.Net ViewState Helper (version 1.1.0) I get errors: 'There was an unknown error parsing and decoding the viewstate' in the ase of the Web Development Helper and 'An error has occurred while Decoding the to the TreeView: The serialized data is invalid' in the case of Asp.Net ViewState Helper.

  • Silverlight Adventures with Blend

    Further to Howard's post regarding our trials and tribulations whilst developing a Silverlight Alpha, app I wanted to share something that I encountered whilst using Blend, and although I don't really have a solution to the problem, it’s certainly worth being aware of as it took me a little while to get to the bottom of it when I first encountered it.

    Background
    the Silverlight site that we were developing was pretty image and animation heavy and as such, the approach I took whilst developing was to have the solution open in both VS 2005 (Orcas Beta 1) and in Blend 2 (May Preview). Additionally, we were using some controls that were based on the Sample Ui Controls that ship with the Silverlight SDK.

    Problem 1
    With this in mind, consider the following Silverlight page declaration and page definition:

    <Canvas xmlns="http://schemas.microsoft.com/client/2007"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:controls="clr-namespace:SomeProjectName.Silverlight.Controls;assembly=ClientBin/ SomeProjectName.Silverlight.Controls.dll"  
            x:Name="LondonCallingTrackListing"
            Loaded="Page_Loaded"
           x:Class="SomeProjectName.Silverlight.App.LondonCallingTrackListing;assembly=ClientBin/TheClash.Silverlight.App.dll"
            Width="1024" Height="768" Background="#00000000">

    ....

    <!-- Some other stuff-->

    <controls:ImageButton Source="Assets/Discography/closeRoll.png" x:Name="imageCloseRoll" Canvas.Left="831" Canvas.Top="109.5" Click="OnCloseClick" Visibility="Hidden" Opacity="0"/> 
    <controls:ImageButton Source="Assets/Discography/close.png" x:Name="imageClose" Canvas.Left="831" Canvas.Top="109.5" Opacity="0"/>

    All pretty innocuous I'm sure you'll agree. So, assume I have finished (for now) using Blend to do the heavy lifting for the animations I'm working on (or whatever it was I was using Blend for in the first place) and decide to save - I would then flick back to VS 2005, reload and run. It’s at this point that I get an error stating that a parse error has occurred.

     Error:

    Silverlight error message
    ErrorCode: 2252
    ErrorType: ParseError
    Message: AG_E_RUNTIME_MANAGED_ASSEMBLY_DOWNLOAD
    XamlFile: LondonCallingTrackListing.xaml
    Line:234
    Position: 179

    Upon inspection what I find is that my declaration:

    <Canvas xmlns="http://schemas.microsoft.com/client/2007"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:controls="clr-namespace:SomeProjectName.Silverlight.Controls;assembly=ClientBin/ SomeProjectName.Silverlight.Controls.dll"  
            x:Name="LondonCallingTrackListing"
            Loaded="Page_Loaded"
            x:Class="SomeProjectName.Silverlight.App.LondonCallingTrackListing;assembly=ClientBin/SomeProjectName.Silverlight.App.dll"
            Width="1024" Height="768" Background="#00000000">

    ....

    <!-- Some other stuff-->

    <controls:ImageButton Source="Assets/Discography/closeRoll.png" x:Name="imageCloseRoll" Canvas.Left="831" Canvas.Top="109.5" Click="OnCloseClick" Visibility="Hidden" Opacity="0"/> 
    <controls:ImageButton Source="Assets/Discography/close.png" x:Name="imageClose" Canvas.Left="831" Canvas.Top="109.5" Opacity="0"/>


    Has been transformed by Blend to:

    <Canvas xmlns="http://schemas.microsoft.com/client/2007"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:controls="clr-namespace:SomeProjectName.Silverlight.Controls;assembly=ClientBin/ SomeProjectName.Silverlight.Controls.dll"  
            x:Name="LondonCallingTrackListing"
            Loaded="Page_Loaded"
            x:Class=" SomeProjectName.Silverlight.App.LondonCallingTrackListing;assembly=ClientBin/TheClash.Silverlight.App.dll"
     xmlns:SomeProjectName_Silverlight_Controls="clrnamespace:SomeProjectName.Silverlight.Controls;assembly=SomeProjectName.Silverlight.Controls.dll"
            Width="1024" Height="768" Background="#00000000">

    ...

    <!-- Some other stuff-->

    < SomeProjectName_Silverlight_Controls:ImageButton Source="Assets/Discography/closeRoll.png" x:Name="imageCloseRoll" Canvas.Left="831" Canvas.Top="109.5" Click="OnCloseClick" Visibility="Hidden" Opacity="0"/> 
    < SomeProjectName_Silverlight_Controls:ImageButton Source="Assets/Discography/close.png" x:Name="imageClose" Canvas.Left="831" Canvas.Top="109.5" Opacity="0"/>

     Note: Not only has Blend added a superfluous assembly reference, but it has also missed out a vital part of the path to that assembly, the ClientBin part and thus, causes the error mentioned earlier.

    I'm not sure why this is happening and I'm sure that somebody else has had this and knows the reason and solution - if so I'd be grateful for a heads up. Equally, it’s not the biggest problem in the world, and in a simple app it’s pretty straight forward to understand the parse errors returned and head straight to the source of the problem. However, due to the way we had created and asynchronously loaded our pages it took me some time to identify what had happened between the time when I had a working app in Vs2005, made a tweak in Blend, saved (in Blend) and then ran it in Vs2005.

    Problem 2
    In the app that we were creating we had many pages that were largely the same, or at least the size, background and general layout was the same, and as such I decided that just copying the Silverlight pages from within the project explorer (in Blend) and then changing the bits that needed changing would be the quickest way to go. And here is when I encountered another small problem.

    The Silverlight pages when created should have the following attributes:

    Build Action: SilverlightPage
    Copy to output: Do Not copy
    Custom Tool: MSBuild:CompileXaml
    ...

    The pages that I copied through Blend had the following attributes:

    Build Action: Embedded Resource
    Copy to output: Do Not copy
    Custom Tool:
    ...

    The result of this, as far as I can remember was that again I got runtime errors and it wasn't until I looked at the proj file to see what had happened that I noticed the difference. Again, this isn't a huge deal, as long as you're aware.

Powered by Community Server (Personal Edition), by Telligent Systems