Featured post
c# - okay, exactly where should i create dynamic controls -
i have been active on 2 questions regarding dynamic controls, answer re-creating on postback, question where correct place this
here 2 questions
we our dynamic control creation overriding createchildcontrols
having looked through lot of controls in reflector, telerik controls thought correct, many people should created in init.
should continue using createchildcontrols or init correct way... why seem such area of confusion..
in truth, both accomplish same thing. if developing controls organization, putting in init fine (as in work though "technically place should be", ms has created method expect go.
if telerik, creating controls else use, put in createchildcontrols
class. why? because, people expect, , ms wants control developers do. have concerned in situation (especially if controls develop aren't sealed), can override different methods, , you've seen lot of people override init
class make code work way want to. want avoid situation code mysteriously doesn't work because forgot call base method, , isn't documented. when put in createchildcontrols
method telling other developers is: "i'm doing creating controls here want take note of." think class base of method if override it.
the other great thing putting in createchildcontrols
lot of people don't know (and people do, know used for). when inherit control , monkey init
, forget call base init
method, code still "magically" works, , don't have fuss figuring out went wrong.
- Get link
- X
- Other Apps
Comments
Post a Comment