Solved

Copy Text to Clipboard

Posted on 2013-01-15
5
516 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 33

Expert Comment

by:paulmacd
Comment Utility
I'm sorry, but you're trying to paste text to the clipboard from a web page?
0
 

Author Comment

by:Dovberman
Comment Utility
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 33

Accepted Solution

by:
paulmacd earned 300 total points
Comment Utility
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
Comment Utility
There seems to be no resolution. I will copy the text to a popup window.
0
 

Author Closing Comment

by:Dovberman
Comment Utility
Thank you.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now