Vous souhaitez copier du texte dans le presse-papiers. La syntaxe de base est:
Clipboard.SetText("The text you want to copy");
Mais pour que cela fonctionne, il y a plus de travail à mettre en, utilisez les liens que je fournis. Vous pouvez trouver plus d'informations here et here pour C# et here pour ASP.net qui est plus pertinent pour vous.
Ce code a été extrait du lien CodeProject aformentioned, et devrait fonctionner en utilisant un thread différent.
private static string _Val;
public static string Val
{
get { return _Val; }
set { _Val = value; }
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Val = label.Text;
Thread staThread = new Thread(new ThreadStart (myMethod));
staThread.ApartmentState = ApartmentState.STA;
staThread.Start();
}
public static void myMethod()
{
Clipboard.SetText(Val);
}
que vous devez faire de JScript/C#? – mlg
http://msdn.microsoft.com/en-us/library/ms535220.aspx – Karthik
http://stackoverflow.com/questions/400212/how-to-copy-to-the-clipboard-in-javascript peut être utile. – mlg