Clipboard

A

alastairgarrow

Hi there

I am looking for some help in getting a clipboard image into an Sql
Database table. My plan is to have a web page that will allow the user
to copy an image on their home computer and paste it into my asp.net
page (perhaps with a simple button) and that image will be
automatically stored into the database table.

Can I access system.windows.forms namespace in a web application? I
have tried this but keep getting an error indicating that the
clipboard object is not available.

I am new to asp.net (I am a fairly seasoned asp developer).

any help much appreciated

AG
 
R

Roland Dick

Hi there

I am looking for some help in getting a clipboard image into an Sql
Database table. My plan is to have a web page that will allow the user
to copy an image on their home computer and paste it into my asp.net
page (perhaps with a simple button) and that image will be
automatically stored into the database table.

I don't think that will work the way you imagine. At the end of the day,
ASP.NET is just a server language which manipulates HTML before it sends
it out to the client. In other words, you're limited to the controls
HTML provides. I see two options for you:

1. Use a fileupload - control. The user will have to select a file and
can't copy the image from the clipboard, though. (If you look around,
that's pretty much the standard way of doing these things). Once they
are uploaded, you can display them in your websites, of course.

2. Use some kind of "fat" application, i.e. a Java applet that might
probably be able to access the clipboard, or maybe a .NET Winforms
application (which can be deployed from your website using ClickOnce).
However, you're very limited in the audience: Not everybody has a Java
VM installed, nor does everyone have a current .NET framework. Plus the
user will have to trust your application.

Can I access system.windows.forms namespace in a web application? I
have tried this but keep getting an error indicating that the
clipboard object is not available.

You can access the System.Windows.Forms namespace if you add a
reference; but IMHO it is neither recommended nor (usually) necessary.
Besides, if you "talk" to the clipboard in the aspx site, it will try to
access the clipboard on your server, not on the client viewing the page
- and because your webserver is not a user, but a service, it doesn't
have a clipboard. Hence the error.
I am new to asp.net (I am a fairly seasoned asp developer).
Well - at the end of the day, asp.net is really just another server
language. From a user's view, you can do with ASP.NET the exactly same
things you can do with ASP, not more, not less.

Hope this helps,

Cheers,
Roland
 
A

alastairgarrow

I don't think that will work the way you imagine. At the end of the day,
ASP.NET is just a server language which manipulates HTML before it sends
it out to the client. In other words, you're limited to the controls
HTML provides. I see two options for you:

1. Use a fileupload - control. The user will have to select a file and
can't copy the image from the clipboard, though. (If you look around,
that's pretty much the standard way of doing these things). Once they
are uploaded, you can display them in your websites, of course.

2. Use some kind of "fat" application, i.e. a Java applet that might
probably be able to access the clipboard, or maybe a .NET Winforms
application (which can be deployed from your website using ClickOnce).
However, you're very limited in the audience: Not everybody has a Java
VM installed, nor does everyone have a current .NET framework. Plus the
user will have to trust your application.


You can access the System.Windows.Forms namespace if you add a
reference; but IMHO it is neither recommended nor (usually) necessary.
Besides, if you "talk" to the clipboard in the aspx site, it will try to
access the clipboard on your server, not on the client viewing the page
- and because your webserver is not a user, but a service, it doesn't
have a clipboard. Hence the error.


Well - at the end of the day, asp.net is really just another server
language. From a user's view, you can do with ASP.NET the exactly same
things you can do with ASP, not more, not less.

Hope this helps,

Cheers,
Roland

Roland

Thanks for this detailed reply. I see the client/server issue now but,
that said, using a javascript clipboard function I can drop text from
the local PC into a web form for upload and hoped it might be possible
to do the same with an image.

The issue is one of usability - to get an image from a website I will
be relying on the user saving to disk and then finding it from the web
app. to place it in the database. I had visions of them simply copying
to clipboard and then clicking a paste from clipboard in the web app.
The simpler the better!

The system is closed so I could use an applet but that is another
learning experience for me. Perhaps I'll have to hire in the
knowledge.

thanks

AG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top