Copy to Clipboard without using Flash plugin in ASP.NET MVC

Hi,

its urgent please help…..

i am developing a asp.net mvc application.

i have a page with textbox and button. when i am clicking the button i want to copy the textbox text to clipboard and i am able paste that copied text in the notepad(like normal paste ctrl+v) and it should work in all browsers

i want this in javascript and i dont want to use any flash plugin. please give sample code

please help…. thanks in advance…..

It’s not possible to do this using Javascript without Flash in all browsers.

Hi Mike, 

Thanks for reply

is there any other option to make this without flash and javascript

i want to use this option mainly in mobiles  

No. You just have to allow users to copy it themselves.

Hi KumarJalli,

For your issue ,I suggest that you can use zeroclipboard to achieve your goal.

Please try the link below:

http://zeroclipboard.org/

Best Regards,

Kevin Shen.

Kevin Shen – MSFT

For your issue ,I suggest that you can use zeroclipboard to achieve your goal.

That component requires Flash. KumarJalli wants a solution that doesn’t require Flash.

Hi Mikesdotnetting,

Thanks for your reminding me.

I agree with your suggestion.

Best Regards,

Kevin Shen.

KumarJalli

is there any other option to make this without flash and javascript

With very limited browser support, you can use
HTML5 clipboard API

https://github.com/zeroclipboard/zeroclipboard/issues/171

http://www.htmlgoodies.com/html5/other/working-with-clipboard-apis-in-html5-web-apps.html#fbid=xF83O4kR46S

I haven’t tried this my own, but there seems to be a trick to achieve the similar requirement. You can look into that to see whether it can help you.

http://stackoverflow.com/questions/17527870/how-does-trello-access-the-users-clipboard

Or may be there are some ActiveX component which can do that but out of the scope of these forums.

Leave a Reply