 <p>Thats because your <code>Tag</code> is <code>Null</code> (or as it's called in VB <code>Nothing</code>). So before you check the length of the Tag, you need to make sure it's not <code>Nothing</code>. e.g with:</p> <pre class="lang-vb prettyprint-override"><code>If Control.Tag Is Nothing Then ... </code></pre>