Click here to Skip to main content
11,408,835 members (60,734 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET Windows
I have a windows application which puts some text data onto the clipboard when a drag operation is initiated. I also have a C# web page which needs to respond to a drop event and interpret what's on the clipboard.

From the research I've already carried out detecting the drop seems quite easy ('just' some javascript) but there are complications with a web page accessing the clipboard, such as security and browser specific problems.

Has anyone here had any experience with this kind of scenario?

Note that I can't change the windows application but I can add code to the website.
Posted 8-Jan-13 3:24am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

window.clipboardData.getData('Text') apparently works in IE, but no other browser. So long as the drop is text only, and the user will probably be prompted, as you would hope.
derek9999 at 9-Jan-13 4:41am
Thanks for the suggestion. I have to support IE, Firefox and Chrome (as a minimum) so the security issues will be a problem. What do you mean by 'and the user will probably be prompted, as you would hope'? Is it because the user has to be an administrator to access the clipboard?
Christian Graus at 9-Jan-13 4:53am
My reading is that it can only work in IE. I meant, as a user of the internet, you hope your browser is secure.
derek9999 at 9-Jan-13 5:01am
Sorry it's been a slow morning! So is there another method to use for non-IE browsers?
Christian Graus at 9-Jan-13 5:03am
I only did a quick google, but not as far as I can see.
derek9999 at 9-Jan-13 5:13am
OK thanks for spending some time on this. I'll give my boss the good news...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 390
1 Sergey Alexandrovich Kryukov 294
2 Maciej Los 155
3 PIEBALDconsult 140
4 Peter Leow 140
0 Sergey Alexandrovich Kryukov 8,626
1 OriginalGriff 6,855
2 Maciej Los 3,322
3 Abhinav S 3,238
4 Peter Leow 3,034

Advertise | Privacy | Mobile
Web03 | 2.8.150414.5 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100