Solved

Copy Text to Clipboard

Posted on 2013-01-15
5
519 Views
Last Modified: 2013-01-15
What do I need to change?

    protected void cmdGetResearchList_Click(object sender, EventArgs e)
    // Builds the symbol list for nasdaq.com
    {
        string strSymbolName1 = "";
        foreach (GridViewRow row in grdWatchList.Rows)
        {
            strSymbolName1 += row.Cells[2].Text + ",";
        }
        txtResearchList.Text = strSymbolName1;
        Clipboard.SetText(txtResearchList.Text);   // Error here

    }

Compiles but errors.

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.

What should I change?

Thanks,
0
Comment
Question by:Dovberman
  • 3
  • 2
5 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 38779780
I'm sorry, but you're trying to paste text to the clipboard from a web page?
0
 

Author Comment

by:Dovberman
ID: 38780061
I am trying to paste text to the clipboard from my own web page.

This code is in my aspx.cs file.

The string is "UNTD,SAIA,HUBG,STR,ARTNA,NWS,AGM,CBU,VLY,"
0
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 300 total points
ID: 38780123
Would it help to just save the text to a file?  I'm not sure you can paste to the clipboard from a web page.
0
 

Author Comment

by:Dovberman
ID: 38781443
There seems to be no resolution. I will copy the text to a popup window.
0
 

Author Closing Comment

by:Dovberman
ID: 38781446
Thank you.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question