I am trying to copy the text in clip board inside the repeater but it's not copying.
Below is what I have tried so far.
protected void rptCopy_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) {
if (e.CommandName == "Copy") {
System.Web.UI.WebControls.LinkButton btnCopy = (LinkButton) rptQuestResponseDtl.Items[0].FindControl("lnkCopy");
System.Web.UI.WebControls.Label txtMsg = (Label) rptQuestResponseDtl.Items[0].FindControl("lblComment");
txtMsg.Focus();
btnCopy.Attributes.Add("onclick", "function copyClipboard(){ CopiedTxt = document.selection.createRange();CopiedTxt.execCommand('Copy'); }");
}
}