Protected Sub GridView_Paga_AT_0_RowCommand(sender As Object, e As GridViewCommandEventArgs)
If e.CommandName = "C_Nif" Then
Dim row As GridViewRow = DirectCast(DirectCast(e.CommandSource, Control).NamingContainer, GridViewRow)
Dim Botao_Nif As ImageButton = TryCast(row.FindControl("ImageButton_C_Nif"), ImageButton)
Dim Nif As String = e.CommandArgument
Botao_Nif.Attributes.Add("onclick", "function copyClipboard(){window.clipboardData.setData('Text'," + Nif + ");CopiedTxt.execCommand('Copy');}")
End If
End Sub
Asked
Active
Viewed 43 times
0

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

Luís Ferreira
- 1
- 1
-
What's the question? – SurvivalMachine Sep 02 '16 at 17:33
1 Answers
0
After some searching the best solution for me is:
If e.CommandName = "C_Nif" Then
Dim row As GridViewRow = DirectCast(DirectCast(e.CommandSource, Control).NamingContainer, GridViewRow)
Dim Botao_Nif As ImageButton = TryCast(row.FindControl("ImageButton_C_Nif"), ImageButton)
Dim Nif As String = e.CommandArgument
Botao_Nif.Attributes.Add("onclick", "window.prompt(""To copy use Ctrl+C. Close with Enter.""," + Nif + ");")
End If

Luís Ferreira
- 1
- 1