.

using a clipboard in c#

    protected void Page_Load(object sender, EventArgs e)
    {
                Page.RegisterStartupScript(“emailall”, @”
        <script>
function ClipBoard()
{
var holdtext = document.all['" + holdtext.ClientID + @"'];
//holdtext.innerText = ‘copied text’; //tdObj.innerText;
//alert(‘allcool’);
Copied = holdtext.createTextRange();
Copied.execCommand(“”Copy”");
}
</script>”);

    }

 

    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        string xxx = “”;// “var range = ‘”;//”mailto:”;
        foreach (BusinessObjects.Contact C in Results)
            if (!string.IsNullOrEmpty(C.Email))
                if (C.Email.Contains(“@”))
                    if (!C.Email.Contains(“\”"))
                        if (!C.Email.Contains(“‘”))
                            if (!C.Email.Contains(“,”))
                                if (!C.Email.Contains(“;”))
                            xxx += C.Email.Trim() + “;”;
//HyperLinkEmail.HRef = xxx
holdtext.Value = xxx;
EmailBut.Attributes["onclick"] = “javascript: ClipBoard(); location=’mailto:?’”;
        if (Results.Count > 0)
            EmailBut.Visible = true;
        else
            EmailBut.Visible = false;

        //string a = “aaaa.Harvey@rsh.nhs.uk;claire.bbbb@colchesterhospital.nhs.uk;”;
        //Response.Write(a.Length);
        //Response.Write(Results.Count);
        //=”mailto:wer@erw.erw?subject=fdsafdas&body=qwerwqexczvzxsfgsdf
    }

What's your thoughts on this?

*

Protected by WP Anti Spam