473,404 Members | 2,213 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,404 software developers and data experts.

ASP Copy from Textbox

I have been looking in the newsgroup but cannot find what I need. I am using Visual Studio to to build a VB.Net application using System.Web.UI.Page NOT windows.forms. The server fills a textbox and sends it to the client. Initially I wanted to print the textbox but after viewing the complexity it was decided we did not want to spend that amount of time on this. Now the desire is for the client clicking a "button" to have the contents of the textbox copied to the windows clipboard so they can paste the textbox contents into Word or Notepad. Please help - Thanks.
Nov 20 '05 #1
8 3781
You are trying to have the web server copy information to the client
clipboard? You can't do this. The nature of ASP.NET is that when the code
executes, it is executing on a web server somewhere. When that code is done
executing (emphasis on "done"), it returns the results of the code (emphasis
on results) to the calling client.

You never have a dedicated real-time connection between the client and
server for the purposes of code processing. It pretty much boils down to
your ASP.NET code can control and "talk" to elements accessible to the
server and your resulting HTML can control and "talk" to elements accessible
to the client.

But because neither HTML or JavaScript give you an API to the client Windows
clipboard, you are out of luck.

However, users can still use the traditional ways to cut, copy and paste
(keyboard shortcuts, right clicking).
"Michael SL" <mi*****************@compuware.com> wrote in message
news:C1**********************************@microsof t.com...
I have been looking in the newsgroup but cannot find what I need. I am

using Visual Studio to to build a VB.Net application using
System.Web.UI.Page NOT windows.forms. The server fills a textbox and sends
it to the client. Initially I wanted to print the textbox but after viewing
the complexity it was decided we did not want to spend that amount of time
on this. Now the desire is for the client clicking a "button" to have the
contents of the textbox copied to the windows clipboard so they can paste
the textbox contents into Word or Notepad. Please help - Thanks.
Nov 20 '05 #2
Scot

I guess I was not clear. I want the client to have a button available which when clicked copies the contents of a textbox without the server ever knowing it occurred. I figure this has to be done through a script which is part of the HTML but I have not been able to figure out how to make this happen. Thanks - Michael
Nov 20 '05 #3
IE supports the clipboardData object in its Browser Object Model. To use
it, do something similiar to this:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

function ClipboardSend()
{
clipboardData.setData("text",txtTest.value)
}

</SCRIPT>
</HEAD>
<BODY>

<Input type="text" ID="txtTest">
<Input type="button" onClick="ClipboardSend()" Value="Copy To Clipboard">

</BODY>
<HTML>

I can't say if this will work in other non IE browsers.

Good luck.
"Michael SL" <an*******@discussions.microsoft.com> wrote in message
news:A0**********************************@microsof t.com...
Scott

I guess I was not clear. I want the client to have a button available

which when clicked copies the contents of a textbox without the server ever
knowing it occurred. I figure this has to be done through a script which is
part of the HTML but I have not been able to figure out how to make this
happen. Thanks - Michael
Nov 20 '05 #4
That works! Thanks a lot. -- Michae

----- Scott M. wrote: ----

IE supports the clipboardData object in its Browser Object Model. To us
it, do something similiar to this

<HTML><HEAD><SCRIPT LANGUAGE="JavaScript"

function ClipboardSend(

clipboardData.setData("text",txtTest.value
</SCRIPT></HEAD><BODY><Input type="text" ID="txtTest"><Input type="button" onClick="ClipboardSend()" Value="Copy To Clipboard"></BODY><HTML

I can't say if this will work in other non IE browsers

Good luck
"Michael SL" <an*******@discussions.microsoft.com> wrote in messag
news:A0**********************************@microsof t.com..
Scot
I guess I was not clear. I want the client to have a button availabl

which when clicked copies the contents of a textbox without the server eve
knowing it occurred. I figure this has to be done through a script which i
part of the HTML but I have not been able to figure out how to make thi
happen. Thanks - Michae

Nov 20 '05 #5
that's a Java Function so it should work on any JAva enabled Broswer..
"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:O7*************@tk2msftngp13.phx.gbl...
IE supports the clipboardData object in its Browser Object Model. To use
it, do something similiar to this:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

function ClipboardSend()
{
clipboardData.setData("text",txtTest.value)
}

</SCRIPT>
</HEAD>
<BODY>

<Input type="text" ID="txtTest">
<Input type="button" onClick="ClipboardSend()" Value="Copy To Clipboard">

</BODY>
<HTML>

I can't say if this will work in other non IE browsers.

Good luck.
"Michael SL" <an*******@discussions.microsoft.com> wrote in message
news:A0**********************************@microsof t.com...
Scott

I guess I was not clear. I want the client to have a button available which when clicked copies the contents of a textbox without the server

ever knowing it occurred. I figure this has to be done through a script which is part of the HTML but I have not been able to figure out how to make this
happen. Thanks - Michael

Nov 20 '05 #6
No, it's not a Java function (at least not in the context of this
discussion). It's not part of any language at all, it's part of the IE BOM
(a member of the window object) and is available to any language that has
access to IE browser objects.

http://msdn.microsoft.com/library/de...pboarddata.asp

"Mike Bulava" <mb*****@comcast.net> wrote in message
news:uI**************@TK2MSFTNGP09.phx.gbl...
that's a Java Function so it should work on any JAva enabled Broswer..
"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:O7*************@tk2msftngp13.phx.gbl...
IE supports the clipboardData object in its Browser Object Model. To use it, do something similiar to this:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

function ClipboardSend()
{
clipboardData.setData("text",txtTest.value)
}

</SCRIPT>
</HEAD>
<BODY>

<Input type="text" ID="txtTest">
<Input type="button" onClick="ClipboardSend()" Value="Copy To Clipboard">
</BODY>
<HTML>

I can't say if this will work in other non IE browsers.

Good luck.
"Michael SL" <an*******@discussions.microsoft.com> wrote in message
news:A0**********************************@microsof t.com...
Scott

I guess I was not clear. I want the client to have a button available which when clicked copies the contents of a textbox without the server

ever
knowing it occurred. I figure this has to be done through a script

which is
part of the HTML but I have not been able to figure out how to make this
happen. Thanks - Michael


Nov 20 '05 #7
Cor
Hi

I was currious about this, and searched for it on Google,

See this link, it gives also a more complete answer on the question.
It is half Dutch and half English, but the main things are English I saw.

Cor
Nov 20 '05 #8
Cor
Before I get back "Hi Cor nothing to see :-)

http://www.krikkit.net/howto_javascr...clipboard.html

Cor

I was currious about this, and searched for it on Google,

See this link, it gives also a more complete answer on the question.
It is half Dutch and half English, but the main things are English I saw.

Cor

Nov 20 '05 #9

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

Similar topics

1
by: Tomomichi Amano | last post by:
Hello. I was wondering how to paste-copy-cut-delete at a SELECTED SPOT in a textBox. Thanks in advance.
4
by: Legendary Pansy | last post by:
I was checking out the 101 C# Samples, specifically Windows Forms - Use the Clipboard. I took a look at the code for a while, and I understand what the program is doing with the cut, copy, pasting...
13
by: John | last post by:
Hi How can I implement cut or copy or paste in code? Thanks Regards
6
by: Ben R. | last post by:
Hi, I've got a vb.net winforms app. Out of the box, I can use Ctrl X, C and V as expected in controls like textboxes. I've got a menustrip, and if I click the link "Add standard items" which...
17
by: Steve | last post by:
I'm trying to code cut, copy, and paste in vb 2005 so that when the user clicks on a toolbar button, the cut/copy/paste will work with whatever textbox the cursor is current located in (I have...
0
by: Tom | last post by:
When I use ctrl-c to copy and ctrl-v to paste from a RichTextBox into NotePad ... I get nice ASCII text with the proper returns. Everything looks good. When I paste into WordPad ... I get the...
11
by: John | last post by:
Hi In a winform app I need to provide a menu with Cut, Copy and Paste options., What code do I use to accomplish cut, copy and paste features for fields on a winfrom? Thanks Regards
8
by: jh | last post by:
I'd like to copy/paste into a listbox during runtime. I can do this for a textbox but can't figure out how to accomplish this for a listbox. Any help? Thanks.
2
by: nelsonbrodyk | last post by:
Hey All, I am trying to implement buttons that follow the command pattern. .NET exposes ApplicationCommands.Cut, copy and paste. I am trying the following: <Button...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.