473,779 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.P age 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 3812
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******** *************** ***********@mic rosoft.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.P age 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="JavaS cript">

function ClipboardSend()
{
clipboardData.s etData("text",t xtTest.value)
}

</SCRIPT>
</HEAD>
<BODY>

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

</BODY>
<HTML>

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

Good luck.
"Michael SL" <an*******@disc ussions.microso ft.com> wrote in message
news:A0******** *************** ***********@mic rosoft.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><SC RIPT LANGUAGE="JavaS cript"

function ClipboardSend(

clipboardData.s etData("text",t xtTest.value
</SCRIPT></HEAD><BODY><Inp ut type="text" ID="txtTest"><I nput type="button" onClick="Clipbo ardSend()" Value="Copy To Clipboard"></BODY><HTML

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

Good luck
"Michael SL" <an*******@disc ussions.microso ft.com> wrote in messag
news:A0******** *************** ***********@mic rosoft.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******** *****@tk2msftng p13.phx.gbl...
IE supports the clipboardData object in its Browser Object Model. To use
it, do something similiar to this:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaS cript">

function ClipboardSend()
{
clipboardData.s etData("text",t xtTest.value)
}

</SCRIPT>
</HEAD>
<BODY>

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

</BODY>
<HTML>

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

Good luck.
"Michael SL" <an*******@disc ussions.microso ft.com> wrote in message
news:A0******** *************** ***********@mic rosoft.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*****@comcas t.net> wrote in message
news:uI******** ******@TK2MSFTN GP09.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******** *****@tk2msftng p13.phx.gbl...
IE supports the clipboardData object in its Browser Object Model. To use it, do something similiar to this:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaS cript">

function ClipboardSend()
{
clipboardData.s etData("text",t xtTest.value)
}

</SCRIPT>
</HEAD>
<BODY>

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

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

Good luck.
"Michael SL" <an*******@disc ussions.microso ft.com> wrote in message
news:A0******** *************** ***********@mic rosoft.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
1707
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
21626
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 via the file menu events using the clipboard. However, what I don't get is how is the program able to produce a context menu in the textbox area. When right clicking, the context pops up and allows to cut/copy/paste/delete, etc.. But the thing is, I...
13
2426
by: John | last post by:
Hi How can I implement cut or copy or paste in code? Thanks Regards
6
9655
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 adds Cut copy and paste commands, this functionality no longer works. It seems now I need to implement handlers for these functions. I tried to do so, but say the paste handler, I need to call paste on a specific control and that isn't necessarily...
17
5129
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 about 20 textboxes on the form). Also to ensure that the button can't get used if the cursor isn't in a textbox field. And to ensure the contents of the clipboard are "text" contents that have been cut/copied from one of the textboxes on the form. ...
0
2154
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 RichText font attributes and paragraph formatting as seen in the RichTextBox. Again, everything looks good. Trying to do the above programmatically is causing me problems. The text is there, but in NotePad the returns are absent and the square...
11
9661
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
15441
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
9326
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 Command="ApplicationCommands.Copy"/> //also have paste and cut. <TextBox Width="50"/> In the designer, selecting the textbox will eneable cut/copy. However when I run the application and go into the textbox and type, non the the buttons enable. Is this some sort of a...
0
9636
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
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
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...
0
10139
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10075
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
8961
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...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
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.