title: asp.net + javascript - passing value to background code with javascript
body: <p>I am using tinyMCE for a nice text editor, but now I am trying to get the text I've inserted, I would like to know how that is possible.
  I've tried:</p>
  
  <p>HTML CODE:</p>
  
  <pre><code>&lt;textarea id="TA_MessageInput"&gt;&lt;/textarea&gt;
  &lt;asp:HiddenField id="HF_MessageInput" ClientIDMode="static" runat="server"/&gt;
  </code></pre>
  
  <p>JAVASCRIPT CODE:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function getTinyMCEText() {
          document.getElementById('&lt;%= HF_MessageInput.ClientID %&gt;').Value = tinyMCE.activeEditor.getContent();
          alert(document.getElementById('&lt;%= HF_MessageInput.ClientID %&gt;').Value);
      };
  &lt;/script&gt;
  </code></pre>
  
  <p>ASP.NET CODE:</p>
  
  <pre><code>ScriptManager.RegisterClientScriptBlock(this, GetType(), "", "getTinyMCEText()", true);
  String text = HF_MessageInput.Value;
  </code></pre>
  
  <p>The javascript gives me the alert that the tag has been filled, unfortunately it did not for ASP.NET, this says it is still null.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>OnClientClick="tinyMCE.triggerSave(false,true);"</p>
  
  <p>^ that was the problem... :)</p>