Last post Jul 03, 2008 04:58 AM by aa.moon
Jul 01, 2008 05:46 AM|beast|LINK
I have few questions regarding custom controls development :
1 - Whats the different in between inherteing from [
WebControl ] or [ CompositeControl ] ?
2 - How to raise IPostBackDataHandler for a calendar control [ selectionChanged Event ]
3 - Do I have to implement IPostBackEventHandler in order to implement
Thanks in advance for you support.
Jul 03, 2008 04:58 AM|aa.moon|LINK
1. Web Control is a base class for single controls like Label and TextBox. Whereever, CompositeControl is a base class for those web controls which contain child controls. Like Login, WizardControl. Moreover, composite controls act like a container control.
2. To raise PostBack event from your extended control you can call this method RaisePostBackEvent(string) or if you want to raise selectionChanged event then you can call OnSelectionChanged() method.
3. IPostBackDataHandler is used to load the PostbackData send by client. you only have to implement this interface if your base calss is not implementing this interface. This interface will force you to implement two methods i.e. LoadPostData and RaisePostDataChangedEvent
But if your base class have implemented this interface already then you normally need to override these methods LoadPostData and RaisePostDataChangedEvent
I hope this help.