IntroductionCopy and Past in Asp.net With the help of javascript its very easy by using Java Clipboard Function and Call from C# or Vb.net and use it To CopyScriptManager.RegisterStartupScript(Me, Me.GetType(), "Copy", "clipboardData.setData('text', '" + TextBox1.Text + "');", True)To PasteScriptManager.RegisterStartupScript(Me, Me.GetType(), "Past", "document.getElementById('textbox2').focus();
PastedText = document.getElementById('textbox2').createTextRange(); PastedText.execCommand('Paste');", True)The Complete codePartial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
ScriptManager.RegisterStartupScript(Me, Me.GetType(), "Copy", "clipboardData.setData('text', '" + TextBox1.Text + "');", True)
ScriptManager.RegisterStartupScript(Me, Me.GetType(), "Past", "document.getElementById('textbox2').focus();
; PastedText = document.getElementById('textbox2').createTextRange(); PastedText.execCommand('Paste');", True)
End Sub
End Class
Sample Project SourceDownload source files -3 kb |