copy & paste with a command button ?

Discussion in 'ASP .Net' started by =?Utf-8?B?TXIuIE11cmFkIEphbWFs?=, Jun 13, 2006.

  1. hi guys,
    I have a textbox & a button in an .aspx page, when I hit the button i want a
    selected text
    to be copied to the clipboard AND paste it into the last cursor position on
    the textbox BOTH AT ONCE, that means, copying & pasting the text must happen
    together on the Button_Click event handler!

    when we use javascript to store the selected text into a variable, we must
    use this code snippet:

    var selectedHtml=(document.selection.createRange()).htmlText;
    if(selectedHtml!= "")
    document.getElementById("TextBox3").focus();
    sel = document.selection.createRange();
    sel.text = selectedHtml;

    now, the exact question becomes: how to copy the sel variable above [which
    holdes the selected html text] to the clipboard and paste it into the LAST
    CURSOR POSITION in the textbox on the Button-Click event handler!!

    Thank you so much in advance !!
    =?Utf-8?B?TXIuIE11cmFkIEphbWFs?=, Jun 13, 2006
    #1
    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. Bogosian
    Replies:
    5
    Views:
    4,765
    Jim Cheshire [MSFT]
    Jan 7, 2004
  2. Alex
    Replies:
    2
    Views:
    1,218
  3. Replies:
    26
    Views:
    2,107
    Roland Pibinger
    Sep 1, 2006
  4. Mr. Murad Jamal

    Copy & paste with a command button?

    Mr. Murad Jamal, Jun 13, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    265
    Mr. Murad Jamal
    Jul 17, 2006
  5. Replies:
    1
    Views:
    309
Loading...

Share This Page