Call VBScript from a link button or ASP HyperLink control

Discussion in 'ASP General' started by Dustin II., Aug 12, 2004.

  1. Dustin II.

    Dustin II. Guest

    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>
    Dustin II., Aug 12, 2004
    #1
    1. Advertising

  2. Dustin II.

    dave Guest

    First clue :

    "I have an ASP.NET solution"


    "Dustin II." <> wrote in message
    news:...
    > 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>
    >
    >
    dave, Aug 15, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vadim Vulfov
    Replies:
    4
    Views:
    5,148
    Bruce Barker
    Apr 26, 2005
  2. John Smith
    Replies:
    0
    Views:
    468
    John Smith
    May 14, 2005
  3. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    815
    Kevin Spencer
    May 17, 2005
  4. alan
    Replies:
    2
    Views:
    6,409
  5. Replies:
    1
    Views:
    318
    Mark Fitzpatrick
    Aug 9, 2008
Loading...

Share This Page