|
Cet article a fait l'objet d'une traduction automatique. Déplacez votre pointeur sur les phrases de l'article pour voir la version originale de ce texte. Informations supplémentaires.
|
Traduction
Source
|
Button.RenderContents, méthode
.NET Framework 4.5
Espace de noms : System.Web.UI.WebControls
Assembly : System.Web (dans System.Web.dll)
Paramètres
- writer
- Type : System.Web.UI.HtmlTextWriter
Objet System.Web.UI.HtmlTextWriter qui représente le flux de sortie utilisé pour rendre le contenu HTML sur le client.
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS.Controls" Assembly="Samples.AspNet.CS" %> <%@ Page language="c#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Custom Button - RenderContents - C# Example</title> </head> <body> <form id="Form1" method="post" runat="server"> <h3>Custom Button - RenderContents - C# Example</h3> <aspSample:CustomButtonRenderContents id="Button1" runat="server" Text="Button" /> </form> </body> </html> ... using System.Web; using System.Security.Permissions; namespace Samples.AspNet.CS.Controls { [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)] public sealed class CustomButtonRenderContents : System.Web.UI.WebControls.Button { protected override void RenderContents(System.Web.UI.HtmlTextWriter writer) { // Call the base RenderContents method. base.RenderContents(writer); // Append some text after the button. writer.Write("<br>Click this button for more information."); } } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (rôle principal du serveur non pris en charge), Windows Server 2008 R2 (rôle principal du serveur pris en charge avec SP1 ou version ultérieure ; Itanium non pris en charge)
Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.