I am trying to get a copy to clipboard in my .ascx file. Since this is ASP.NET, there is no main function to put [STAThread] on.
I am getting an error stating: "Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it."
In my ascx.cs file I have using System.Windows.Forms;
and then one line of code Clipboard.SetText("Hello, clipboard");
I've attempted to find a solution, but most solutions assume that there is a main, or say to delete dlls. These solutions are not fit for my situation.