I have a mailto button that copy the actual link of my page.I want that when my users click on the button, it copies them a hyperlink with the link of my page
public void GenerateShareMenu(string copyLink, string emailLink, string msTeamsLink = "") { this.ClientSideEvents.ItemClick = "MenuNoPostBackForGridActionMenu"; var moreMenu = this.Items.Add(); moreMenu.Name = "RootMenu"; moreMenu.TextTemplate = new ITAMMenuTemplate("share", string.Empty, false); var copyLinkMenu = moreMenu.Items.Add(); copyLinkMenu.Text = PSStringUtils.GetString("CommonCopyLink"); copyLinkMenu.Name = "RootCopyMenu"; copyLinkMenu.TextTemplate = new ITAMMenuTemplate("link", copyLinkMenu.Text, false); copyLinkMenu.NavigateUrl = copyLink; //if (!string.IsNullOrEmpty(msTeamsLink)) //{ // var msTeamsMenu = moreMenu.Items.Add(); // msTeamsMenu.Text = PSStringUtils.GetString("CommonTeams"); // msTeamsMenu.Name = "RootMSTeamsMenu"; // msTeamsMenu.TextTemplate = new ITAMMenuTemplate("groups", msTeamsMenu.Text, false); // msTeamsMenu.NavigateUrl = string.Format(CultureInfo.InvariantCulture, @"javascript:$('#{0}').click();", msTeamsLink); //} if (!string.IsNullOrEmpty(emailLink)) { var sendMailLinkMenu = moreMenu.Items.Add(); sendMailLinkMenu.Text = PSStringUtils.GetString("Common_SendEmail"); sendMailLinkMenu.Name = "RootSendMailMenu"; sendMailLinkMenu.TextTemplate = new ITAMMenuTemplate("forward_to_inbox", sendMailLinkMenu.Text, false); string htmlLink = $"<a href='{HttpUtility.HtmlEncode(emailLink)}'>Oui</a>"; string emailBody = HttpUtility.UrlEncode(htmlLink); sendMailLinkMenu.NavigateUrl = $"mailto:?body={emailBody}"; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)