I have trouble understanding, when I have to override and why I have to override. I'm using a WebUserControl
I tried to use
Protected Sub Overrides OnPreRender(ByVal writer As System.Web.UI.HtmlTextWriter)
but then I get the error
sub 'OnPreRender' cannot be declared 'Overrides' because it does not override a sub in a base class.
And when I removed Overrides I get the warning
sub 'OnPreRender' shadows an overridable method in the base class 'Control'. To override the base method, this method must be declared 'Overrides'
and the event doesn't execute.
When I changed the name to
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
the event executes. Is there a Render event in the base of the WebUserControl to Override?
I have trouble to understand why I have to override an event and not use the event as it is. I would be glad if someone could explain all of this thoroughly.