Hi, I have an ASP.NET solution, and the ASPX page I have a form , I want to
copy some of the data from that form to the clipboard, I am using the below
script the script works fine when I use a normal anchor tag with the onclick
event, but I want to be able to use an actual asp control like the hylperlink
or linkbutton. I have tried the link button but it gives an error saying
Compiler Error Message: BC30456: 'VBScript' is not a member of 'ASP.sr_aspx'.
And the hyperlink control doesn't seem to have an option for the onclick. The
code is located in the .aspx not in the .vb. Thanks!

<script language="vbscript" type="text/VBScript">
sub CopyToClip
dim mytext
mytext = document.Form1.txtNote.Value
call window.clipboardData.setData("Text", mytext)
end sub
</script>

Re: Call VBScript from a link button or ASP HyperLink control by dave

dave
Sat Aug 14 20:13:51 CDT 2004

First clue :

"I have an ASP.NET solution"


"Dustin II." <DustinII@discussions.microsoft.com> wrote in message
news:8385C42E-0CF4-431B-BAF5-C50026C1C8D0@microsoft.com...
> Hi, I have an ASP.NET solution, and the ASPX page I have a form , I want
to
> copy some of the data from that form to the clipboard, I am using the
below
> script the script works fine when I use a normal anchor tag with the
onclick
> event, but I want to be able to use an actual asp control like the
hylperlink
> or linkbutton. I have tried the link button but it gives an error saying
> Compiler Error Message: BC30456: 'VBScript' is not a member of
'ASP.sr_aspx'.
> And the hyperlink control doesn't seem to have an option for the onclick.
The
> code is located in the .aspx not in the .vb. Thanks!
>
> <script language="vbscript" type="text/VBScript">
> sub CopyToClip
> dim mytext
> mytext = document.Form1.txtNote.Value
> call window.clipboardData.setData("Text", mytext)
> end sub
> </script>
>
>