473,320 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Clipboard

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

Mar 11 '07 #1
2 5571
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
Mar 12 '07 #2
On Mar 12, 3:47 am, Roland Dick <bris...@web.dewrote:
alastairgar...@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
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

Mar 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: xyz | last post by:
I have a menu item to handle clipboard actions (cut, copy, paste). When I paste text that I copied from a Hungarian web page, the display looks normal on my RichTextBox, but the text retrieved from...
8
by: LG | last post by:
Just have a question with regards to the clipboard, and how to read what other applications (Adobe InDesignCS) place in the clipboard. I am currently in the process of creating a booklet from a...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
0
by: James Russo | last post by:
Hello, I have an application which requires an image to be retrived from the clipboard. So, I am writting a quick C# windows application to take images from a webcam and store a single frame on...
7
by: Newbie | last post by:
How do I clear the clipboard in VB.NET 2003? TIA Newbie
15
by: Peter Duniho | last post by:
I'm trying to use .NET and C# to draw a metafile copied to the clipboard by another application (Word 2003 in this case, but it shouldn't matter). I naively thought that I'd be able to use the...
1
by: Figmo | last post by:
Wow.....this is darned odd.... I have an app that integrates with other applications. It registers a global hotkey with Windows. When the hotkey executes it sends a CTRL-C to the active...
8
by: active | last post by:
Guess I'm looking for someone who likes to work difficult puzzles. I can't seem to ever retrieve a palette handle from the clipboard. Below is a simple test program that demonstrates the...
20
by: Joe Duchtel | last post by:
Hello - I have the following code to get a bitmap from the clipboard and to save it to a *.png file ... Dim lData As IDataObject = Clipboard.GetDataObject() If...
23
by: Over | last post by:
Hi it's possible with language C, (Mingw or Djgpp) copying the clipboard of WinXp into file.txt? which function must be use. Thanks
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.