Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Custom Controls: ascx file vs. classfiles - what's the best way?


Message #1 by Philip Steel <PhilipS@t...> on Wed, 12 Jun 2002 16:37:32 +0100
Hi all

I was wondering what the disadvantages/advantages were of authoring your
cutom controls and using ASCX files
instead of defining a class that derives from System.Web.UI.Control and
overriding its Render method, thus:

using System;
using System.Web;
using System.Web.UI;

namespace SimpleControlSamples {

    public class Simple : Control {

       protected override void Render(HtmlTextWriter output) {
           output.Write("<H2>Welcome to Control Development!</H2>");
       }
    }    
}

Cheers

Phil


Phil Steel
TEQUILA\ Digital
82 Charing Cross Road
LONDON WC2H 0QB
020 7557 6228


  Return to Index