title: copy to clipboard in c# asp.net
body: <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Windows.Forms; // step 1
  
  namespace School.Admin
  {
  
  public partial class Test : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
      }
  
      [STAThreadAttribute] // step 2
      protected void LinkButton1_Click(object sender, EventArgs e)
      {
          Clipboard.SetText(&quot;Why it did not copy the words&quot;); //step 3
      }
  }
  </code></pre>
  <p>}</p>
  <p>the erorr is:</p>
  <p><strong>The current thread must be set to Single Thread Apartment (STA) mode before OLE calls can be made. Make sure the Main function is checked</strong></p>