title: JavaScript runtime error: Unable to set property
body: <p>From the start of my code writing I set a Local message trap, in case of sending messages to the user. The trap is that.</p>
  
  <pre><code>Dim message As String = Nothing
          message = "bla bla bla"
          UserBirthDate.Text = Nothing
          LocalErrorMessage("InnerMessages", message)
          btnClr.Visible = True
          Return
  
  Public Sub LocalErrorMessage(DivID As String, Message As String)
          errorCall = False
          Dim cstype As Type = Me.GetType()
          Dim innerMess As String = Message
          Dim url As String = HttpContext.Current.Request.Url.AbsoluteUri
          Dim script As String = "InnerMessages('" + DivID + "', '" + innerMess + "')"
          If Not Page.ClientScript.IsStartupScriptRegistered(Me.GetType(), "MessageDiv") Then
              Page.ClientScript.RegisterStartupScript(cstype, "MessageDiv", script, True)
          End If
      End Sub
  </code></pre>
  
  <p>I also set a small java script at the start of my code.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function InnerMessages(TagID, mess) {
          document.getElementById(TagID).innerHTML = mess + '&lt;br/&gt;&lt;hr/&gt;'; 
        }
      &lt;/script&gt;
  </code></pre>
  
  <p>The all issue working fine... and I have to continue writing my code (which is a user registration page). Everything goes fine until today... When I saw a message once... and works fine... since this time never works again...<br/>
  Always throw me the error</p>
  
  <blockquote>
    <p>JavaScript runtime error: Unable to set property 'innerHTML' of undefined or null reference</p>
  </blockquote>
  
  <p>So I set another script </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      window.onload = getTag()
      function getTag() {
          var pWin = window.parent.document;
          return pWin;
      }
  </code></pre>
  
  <p>And I was modify the initial one</p>
  
  <pre><code>&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
      function InnerMessages(TagID, mess) {
      var myTD = getTag();
      var t = myTD.forms.Form.childNodes;
      var s = t['355'].childNodes['0'].nodeValue;
      document.getElementById(TagID).innerHTML = mess + '&lt;br/&gt;&lt;hr/&gt;'; 
        }
      &lt;/script&gt;
  </code></pre>
  
  <p>That works once or twice... but not any more...<br/>
  I can't understand why that happen...<br/></p>
  
  <p>Is there someone how can assist me? </p>