473,804 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5588
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.de wrote:
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
2241
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 the clipboard is corrupted. For example, a U with double accent ( byte code x'FB' ) is replaced by a question mark in my txtEdit.Text after a Paste operation. It seems that the Clipboard.GetText() is changing the data. How is it possible to...
8
11480
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 database, and I need the data to be laid out in a tabular format, and set out in a specific way. At the current point in time, I am copy/pasting the raw text from the database into a table layout in InDesign. What I was thinking is that if I could...
7
11647
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 is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an OpenFileDialog: Dim result As DialogResult = Pic_Sel.ShowDialog() If (result = DialogResult.OK) Then
0
1909
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 the clipboard so it can be pasted into this other application. My solution is working fine with all applications (mspaint, word, wordpad) except the one I need it to work with. I've contacted the vendor of the application, but I haven't been able...
7
3856
by: Newbie | last post by:
How do I clear the clipboard in VB.NET 2003? TIA Newbie
15
12305
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 Clipboard class to get an EnhancedMetafile or MetafilePict object from the Clipboard, use that to create a new Metafile object, and then draw that Metafile object using Graphics.DrawImage. It doesn't seem to be that simple.
1
18675
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 window (any application) to copy whatever text is selected to the clipboard. It then issues a C# Clipboard.GetText(...) and does some processing with this string. All is good, no errors thus far.
8
2506
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 problem. The program uses windows api to get a handle to a palette from the clipboard. The palette needs to be put there by another program - maybe Photoshop.
20
7019
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 lData.GetDataPresent(DataFormats.Bitmap) Then Dim lPictureBox As New PictureBox
23
6311
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
9714
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10096
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9174
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5534
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.