T
tshad
I am creating a string with data from my GridView in a CSV format that I
want to write to a file. I am trying to write the data into the Clipboard
and allowing the user to paste the data into the notepad and then saving the
file, since there doesn't seem to be a way to do that directly from the web
page.
I finally figure out how to do it by putting the data into a string, moving
the string to a textbox and then executing a javascript function to read the
data from the textbox and copy the data to the clipboard:
function ClipBoardTest()
{
var txt = document.getElementById("<%= MyText.ClientID %>");
window.clipboardData.setData("Text", txt.value);
}
But this means I have to put the data into a string (stringbuilder) and then
copy that to the textbox.
Is there a way to call the javescript directly and pass the string to it and
have it do the clipboard function on the string?
Thanks,
Tom
want to write to a file. I am trying to write the data into the Clipboard
and allowing the user to paste the data into the notepad and then saving the
file, since there doesn't seem to be a way to do that directly from the web
page.
I finally figure out how to do it by putting the data into a string, moving
the string to a textbox and then executing a javascript function to read the
data from the textbox and copy the data to the clipboard:
function ClipBoardTest()
{
var txt = document.getElementById("<%= MyText.ClientID %>");
window.clipboardData.setData("Text", txt.value);
}
But this means I have to put the data into a string (stringbuilder) and then
copy that to the textbox.
Is there a way to call the javescript directly and pass the string to it and
have it do the clipboard function on the string?
Thanks,
Tom