Writing to the clipboard

T

tshad

This is really frustrating.

I can't seem to find a easy way to write a csv file from a web page to the
disk, which is what my client needs.

I am taking the data from a GridView and putting it to disk, which works
fine when running from VS. But not from a web page running from IIS.

I then tried to write the text to the clipboard but there doesn't seem to be
a simple way to this either???

All I can seem to find is some irritating javascript that I can't seem to
get to work either.

Isn't there a class like the Clipboard class for a Windows app???

I know this isn't a security problem as other web pages do this. This
should be dead bang easy.

If I can't write to a file, I need to get a way to get my text data to a
file on the disk, even if it means the user has to jump through hoops to get
it there (text to clipboard to notepad to file on disk).

Thanks,

Tom
 
T

tshad

I did get it to work finally with the button, but couldn't find a way to
call the Javascript from the code.

This requires the user to press a button to build the CSV data and put it in
a string then to the hidden field on the screen and then the user has to
push another button to get the data into the clipboard.

<script language="javascript" type="text/javascript">
function ClipBoardTest() {
var txt = document.getElementById("<%= MyText.ClientID %>");
window.clipboardData.setData("Text", txt.value);
}

</script>

I would rather chane the code to call the javascript directly and pass the
string directly to the code instead having the user press a button.

Thanks,

Tom
 

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,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top