Skip to main content
  1. Tags/

Dotnet

ASP.NET 2.0 menu rendering differently in browser and at w3.org validator

·1 min

I ran in to something strange today…

The ASP.NET 2.0 Menu control renders differently in a browser and in the W3 validator. Loading the page in a browser results in the usage of the correct attribute ‘vertical-align’ for the image which is used to indicate a menu has subitems. I checked this in IE and FireFox and both browsers rendered correct XHTML. When you copy the source of the rendered page and paste it in the validator-textbox at W3.org, it validates the XHTML. When you check the page directly by entering a URL, the menu renders using the non-correct attribute ‘valign’, causing my page to fail validation.  But the copied source passes validation!

.NET remoting (http binary): passing (custom) errors

·1 min

We are using binary .NET remoting over http for a client-server application. At the server, we have implemented custom error handling which results in the Service Interface (the facade layer) to throw a decent exception, with lots of information. The problem we encounter now is that most of the time the client displays these exceptions as BinaryFormatter exceptions, in stead of the ApplicationException or the normal Exception we throw serverside.

No-touch deployment & reading your config file

·2 mins

When you use No-touch deployment, reading your config file might cause some problems.

I experienced this when I received a ‘No message was deserialized prior to calling the DispatchChannelSink’ error last week. It took me quite some time before I found the problem, because of the strange error. After a while I thought about the way my app was starting: I started a separate thread which configured a remoting interface based on the config file: RemotingConfiguration.Configure(). This because of the non-standard binary formatter that was used. The thread didn’t throw an exception (I know, bad programming, but it was a proof-of-concept 😉 ) and so the app tried to communicate with the remoted object….. which resulted in the error above.

VS2005, a first look

·1 min

Last week I played with VS2005 a little. My first overall impression is: sweet! Partial classes, nullable types, generics, master pages, new controls, great extra debug info… they all make our life a little easier.

Howto: create a custom httpHandler

·3 mins

If you would like to (for example) make sure all the jpegs on your site are displayed including a copyright text or something like that, you could use the example I posted before. But it would be easier to write a custom httpHandler. Here’s a small howto:

HowTo: Thread safe singleton implementation of a class

·2 mins

Normally, if you would like a singleton implementation of a class, you would go about it a little bit like this:

public class BloggingAbout
{
   
private static BloggingAbout bloggingAbout;
   
    private BloggingAbout()
    {
    }

Structuring your projects

·1 min

At my current project, I’m trying to bring some structure in our visual Studio projects. But I’m finding myself not sure about how far I should go. Maybe you should know I tend to be something of a purist. At the moment, we created a project with a single class, because it didn’t belong anywhere else. So we created a client specific ‘Common’ project and put the one file there.

Remoting, serialization error, CallContext, Clone()

·2 mins

I couldn’t come up with a decent title for this post, so I just spit out some keywords.

We got an error today, stating the Controller of some object we wanted to put on CallContext needed to be serializable. Not thinking about the weird content of this error, we tried what would happen if we made the controller serializable. We now got a different error, which was even more weird: