HighTechTalks DotNet Forums  

Copy image to Clipboard not working in Firefox & Chrome

VC++.net microsoft.public.dotnet.languages.vc


Discuss Copy image to Clipboard not working in Firefox & Chrome in the VC++.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Sajin Sasidharan
 
Posts: n/a

Default Copy image to Clipboard not working in Firefox & Chrome - 04-23-2012 , 07:53 AM






I need one help regards JavaScript. I used this script in asp.net
website to copy image in an image control on button click.

<script type="text/javascript">
function CopyToClip() {
var imgControl =
document.getElementById('imageControlWithImageToCo py');
imgControl.contentEditable = 'true';
var controlRange;

if (document.body.createControlRange) {
controlRange = document.body.createControlRange();
controlRange.addElement(imgControl);
controlRange.execCommand('Copy');
}
imgControl.contentEditable = 'false';
return true;
}
</script>

This code for copying image (which is in an image control) to
clipboard and it works fine in IE.

But this script is not working in Firefox & Chrome.

Please suggest any good solution to work in Firefox & Chrome

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.