Link to home
Start Free TrialLog in
Avatar of Relegence
RelegenceFlag for Israel

asked on

Retrieving clipboard data

Hello,
I am writing a c# asp.net application.
I have a div and 2 buttons - an html "Paste" button and an ASP "Submit" button.
When pressing the "Paste" button I am putting the text from the clipboard to the div using:
var text = clipboardData.getData("Text");
document.all("divData").innerHTML = text;

The problem is that when pressing the server side "Submit' button, I want to use the div's data. Instead of returning the data I just pasted from the clipboard, I get the data that was in the div previously.

I guess it is because the "Paste" function occurred on the client and the server doesn't know the data has changed.

How can I "Paste" data from the clipboard and use it in my "Submit" function?

Thank you
SOLUTION
Avatar of cezarF
cezarF
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sebouhh
sebouhh

Hello
I've notice this was posted almost a year ago, but i tried the code, my divData.InnerHtml is bringing nothing. Also, the asp:hiddenfield is giving error, do you think this is .net version issue? i'm using 1.1

is there any other solution to read the innerHTML of div object?

thank you
Seb