al************@nevishost.co.uk schrieb:
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