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

how to copy contents of literal to clipboard via button on a page?

asp.net 2.0

Well until I started looking for how to do this I figured it would be very
easy and lots of information out there. Maybe I'm not looking in the right
places.

I have some code in VB that's creating a list of names and populating a
literal control on the page. I'd like to put a button on the page that let's
the user copy the contents of the literal to the clipboard. As I write this
I'm thinking this probably needs to be client side JS instead of serverside
VB. I'm not very familiar yet with JS so any help anyone can give me would
be greatly appreciated.

I found this but have no idea how to implement it into my page markup.
Please assume I'm in about 1st grade when it comes to JS.

window.fCopyToClipboard = function(rSource){ rSource.select()
if(window.clipboardData){ var r=clipboardData.setData('Text',rSource.value);
return 1; } else return 0 }

the above code is from this site:
http://www.esqsoft.com/javascript-he...t-and-copy-to-
clipboard.htm

I assume it needs to fit into here somehow but I don't know the details:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
<script language="javascript" type="text/javascript">
<!--

// -->
</script>

<br />
Click the radio button of the list you want to create and then click the
"Create
List" button.<br />
<br />
You can select all the itmes in the list and copy/paste it to wherever
you need
it.
</asp:Content>
The ID of my literal control is: "ltrlStudentList"
Thanks,

Keith

Jun 27 '08 #1
0 1198

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

Similar topics

1
by: tabonni | last post by:
Hi all I want to create an ASP page, which can copy the real PDF files into the clipboard and then the user can paste it in Outlook message as attachments(it's like inserting attachments) My...
7
by: Wayne Wengert | last post by:
I have an ASP page in which I want to copy the contents of a variable (text) to the clipboard. Based on MSDN examples I tried window.clipboardData.setData(strTemp) and that generates an error...
5
by: tabonni | last post by:
Hello All I am creating an ASP page. There are a list of filename and checkbox next to it. When user checked all the documents they want and click ADD TO CLIPBOARD button. All filepaths will be...
6
by: Shyguy | last post by:
I want to create two buttons on a form. One would allow the user to Copy the contents of the current records memo field, the other would allow them to print. I set up a report based on the memo...
3
by: Phil Stanton | last post by:
I am trying to produce a program that will output any Access report to an editable Word document. So far it is working well but slowly with text boxes, labels, and lines. I now need to try to...
4
by: Wayne Wengert | last post by:
I have an aspx page on which I am trying to copy the contents of a textbox to the client clipboard when the users clicks a button. The button code is as follows:...
8
by: Michael SL | last post by:
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...
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...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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.