Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Windows
Hi,
I have a windows application which puts some text data onto the clipboard when a drag operation is initiated. I also have a C# asp.net 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
derek99993.2K

1 solution

Rate this: bad
good
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.
  Permalink  
Comments
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 Sergey Alexandrovich Kryukov 279
1 OriginalGriff 190
2 DamithSL 185
3 Peter Leow 105
4 Kornfeld Eliyahu Peter 105
0 OriginalGriff 7,355
1 DamithSL 5,254
2 Sergey Alexandrovich Kryukov 4,942
3 Maciej Los 4,906
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2014
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