What is a NullReferenceException, and how do I fix it?

What is the cause? Bottom Line You are trying to use something that is null (or Nothing in VB.NET). This means you either set it to null, or you never set it to anything at all. Like anything else, null gets passed around. If it is null in method “A”, it could be that method “B” passed a null to method “A”. null can have different meanings: Object variables … Read more

HTML encoding issues – “” character showing up instead of ” “

Somewhere in that mess, the non-breaking spaces from the HTML template (the  s) are encoding as ISO-8859-1 so that they show up incorrectly as an “” character That’d be encoding to UTF-8 then, not ISO-8859-1. The non-breaking space character is byte 0xA0 in ISO-8859-1; when encoded to UTF-8 it’d be 0xC2,0xA0, which, if you (incorrectly) … Read more

What is a NullReferenceException, and how do I fix it?

What is the cause? Bottom Line You are trying to use something that is null (or Nothing in VB.NET). This means you either set it to null, or you never set it to anything at all. Like anything else, null gets passed around. If it is null in method “A”, it could be that method “B” passed a null to method “A”. null can have different meanings: Object variables … Read more