title: How can I get a OnClick Event to execute only once?
body: <p>I've created a <code>&lt;asp:textbox id="TextBoxPassnummer" OnClick="openPopup()" /&gt;</code>. When a user clicks on the textbox a popup windows opens via JS:</p>
  
  <pre><code>function openPopup(){
      var myWindow = newwindow = window.open("http://localhost:59969/test.aspx", "Anleitung", "width=200, height=800, toolbars=0, width=950, left=200,top=200,scrollbars=1,resizable=1");
  }
  </code></pre>
  
  <p>The Popup-Windows contains Information on what to enter in the Textbox(<code>TextBoxPassnummer</code>). After the user closed the Popupwindow the method <code>openPopup()</code> shouldn't execute again if he click on the textbox to enter his information. With my Code shown above, the PopupWindows opens everytime.</p>
  
  <p>How do I solve this Problem, any Suggestion? Thanks...</p>
  
  <p>Tried it like this too:</p>
  
  <pre><code>     &lt;% bool windowHasOpened = false;     %&gt;
  
      if(windowHasOpened == false){
  
  
      function openPopup(){
  
  
          var myWindow = newwindow = window.open("http://localhost:59969/test.aspx", "Anleitung", "width=200, height=800, toolbars=0, width=950, left=200,top=200,scrollbars=1,resizable=1");
          &lt;%windowHasOpened = true;  %&gt;
      }
  </code></pre>