Control
:
Render
:
WebControl inherited from
Control class, And overwrites
Render
Method. This method should be overwritten by subclass.
RenderChildren: child node used to present the control
(Usually
HTML)
RenderControl
: Used to render controls
(
Is
Control
Object
)
RenderChildren is the rendering control, while
CreateChildControls is mainly used to initialize the child control (note that it is not used to render the child control ).
WebControl:
(
Inheritance
Control
Methods
)
About
Render
Several important methods
(
The method parameters are
HtmlTextWriter (related
Three enumeration types:
HtmlTextWriterTag
,
HtmlTextWriterAttribute
,
HtmlTextWriterStyle
))
:
AddAttributesToRender:
The subclass of WebControl should override this method to include the outermost layer for rendering.
HTML Element
Code for HTML attributes
Block.
RenderBeginTag:
The subclass of WebControl should override this method to include the outermost layer for rendering.
Code for opening the HTML Element
Block.
RenderContents:
The subclass of WebControl should override this method to include the outermost layer for rendering.
Nested between opening and closing tags of HTML elements
HTML code block.
RenderEndTag:
The subclass of WebControl should override this method to include the outermost layer for rendering.
Code for disabling HTML elements
Block.
TagKey attribute: Read-only attribute, used to set the outermost layer
HTML Element
HTML element.
Event Call Sequence
- CreateChildControls
- OnInit
- TrackViewState
- LoadViewState
- LoadPostData
- OnLoad
- RaisePostDataChangedEvent
- OnBubbleEvent)
- OnPreRender
- SaveViewState
- RenderControl
- Render
- RenderBeginTag
- AddAttributesToRender
- CreateControlStyle
- RenderContents
- RenderChildren
- RenderEndTag
- OnUnload