0

I'm attempting to access the system clipboard using ASP with Chrome. The server page includes System.Windows.Forms, among other dependencies. When I debug the page using the ASP Development Server through Visual Studio, the page runs fine, and does what I expect. However, if I try to run with IIS, without debugging through the ASP Development Server, I get 500 internal server error. I've searched on getting more information about the error, but it seems that Chrome doesn't provide a method for retrieving "non-friendly" server error messages. Any ideas on what could be going wrong? What is different about the ASP Development Server provided by Visual Studio from the ASP Server in IIS? Thanks in advance.

1 Answers1

0

Woah there cowboy, you don't want to reference System.Windows.Forms from a ASP.NET project. System.Windows.Forms is used for native windows application development and it will not be accessible through a website and certainly not through IIS.

If you're trying to access the clipboard on your page, then check out this answer from elsewhere on SO. It is a simple flash control that you can embed in your page which exposes the clipboard to your page javascript so you can manipulate that data as needed from there.

Community
  • 1
  • 1
Ken
  • 1,110
  • 2
  • 10
  • 26
  • I appreciate the response. I've looked into zeroclipboard, but it only allows for transfer of text. I'm trying to screen capture an image from a canvas, and set this to the clipboard. I call canvas.toDataURL() which returns the base64 image data, but posting this to the clipboard would just be text. I believe I would need a way to post binary data to the clipboard, and I don't think zeroclipboard supports this. As a side note, the functionality from System.Windows.Forms does work through IIS with IE, just not Chrome. – Michael Chase Aug 06 '14 at 20:04
  • In that case you may want to just provide the image as a downloadable file rather than forcing it into the clipboard. – Ken Aug 06 '14 at 20:05
  • Downloading and opening in a new window is all I've been able to accomplish, and I thought I'd try asking on here, but it seems the clipboard access is pretty locked down at this time. Thanks again. – Michael Chase Aug 06 '14 at 20:08
  • Clipboard access is locked down for good reason. You don't want any random website to sniff your clipboard contents, so browsers severely restrict that level of I/O for security's sake. =) – Ken Aug 06 '14 at 20:09
  • Gotcha. There is a clipboard API proposal by W3C, but it's not yet implemented. – Michael Chase Aug 06 '14 at 20:11