WebControl: Esempio in C#
Esempio di un WebControl Asp.NET realizzato in C#
C#
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace Sgart.Root.Base
{
/// <summary>
/// esempio di un semplice webcontrol
/// </summary>
[ToolboxData("<{0}:Footer runat=server></{0}:Footer>")]
public class Footer : System.Web.UI.WebControls.WebControl
{
/// <summary>
/// Render this control to the output parameter specified.
/// </summary>
/// <param name="output"> The HTML writer to write out to </param>
protected override void Render(HtmlTextWriter output)
{
output.Write("<div id=\"Footer\">");
output.Write("<a href=\"http://www.sgart.it/\">");
output.Write("<img src=\"images/Logo_sgart.gif\" target=\"_blank\" />");
output.Write("</a>");
output.Write("</div>");
}
}
}