Quick Start Tutorial Custom Control from ASP.NET (2)

xiaoxiao2021-03-06  99

Quick Start Tutorial Custom Control from ASP.NET (2)

Directory: 1. Development Template Control 2. Development Template Data Binding Control 3. Example 4. Overrive control analysis 5. Define custom control generator

'------------------------------------- -------------------------------------------------- ----1. Development template control

ASP.NET Page Framework allows control developers to separate the user interface with control logically with controls by using template creation. The page developer can customize the display of the control by providing the UI to the parameters between the template tag. The template control has an attribute of one or more types to system.web.ui.Itemplate: public property MessageTemplate AS Itemplate property (in above, in parentheses) Specify the type of container (parent) control. The Itemplate interface has a method Instantiatein, which dynamically creates an instance of the control. This is called on the Itemplate property in the CreateChildControls method: protected overrides sub createchildControls () if MessageTemplate <> null damplate.instantiatein (me) end if ... End Sub

EXP '*********************************************************** *********************************************************** ***** 'template1.aspx <% @ register tagprefix = "templatecontrolsamples" namespace = "templatecontrolsamplesvb"

AskEMBLY = "TemplateControlsamplesVB"%>