clipboard

J

Jaez

I have a VB6 application running on my laptop that outputs text to the
clipboard.

I would like to open a webpage hosted on my asp.net 2 powered website and
when the webpage opens a textbox already has a copy of the text from the
clipboard displayed in it

I have seen the following line suggested as a possibility

window.clipboardData.getData("Text");

but have no idea how to add this to my form load code beyond this which
doesnt work?

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
textbox2.text=window.clipboardData.getData("Text");
End Sub

Jaez
 
S

Scott M.

ASP.NET is server-side code. To access the client's clipboard, you need
client-side code.
 
J

Jaez

Scott M. Thanks for your comments

I realize that I need to run the code on the clients station as the
clipboard in question is the clients clipboard and that I need the ASP.NET
server-side code to generate Javascript on the client.

The question is HOW do I get something like
textbox2.text=window.clipboardData.getData("Text"); to run at the client and
return the text into an ASP type textbox

Jaez
 
S

Scott M.

response.write("<script
type='text/javascript'>textbox2.text=window.clipboardData.getData('Text')</script>");
 
J

Jaez

I am really sorry to have to persist but adding the line given my Scott M
into the form load procedure I can still not get it to paste the clipboard
contents into textbox2.text as the form loads.

I tried putting as a button click and nothing gets printed

More help please
 
J

Jaez

Because they are running an application we have written in VB6 that puts the
data on the clipboard and then opens the webpage from code

All I need to know is how to get the result of the
window.clipboardData.getData('Text') into an asp.net textbox and the line
response.write("<script
type='text/javascript'>textbox2.text=window.clipboardData.getData('Text')</script>");
gets the clipboard but does not seem to communicate with textbox2.text

Jaez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,200
Latest member
LaraHunley

Latest Threads

Top