Page Listing 5-9 page 102-103
Dr. Khosravi -
I am wondering about this CreateContainerChildControls method:
is it better to create controls in this method and add them to Controls collection or like you wrote looks that that controls should be declared somewhere else?
Example :
You write :
case ContainerType.PaymentMethodLabel:\
paymentMethodLabel = new Label();
paymentMethodLabel.Width = Unit.Percentage(100)
.
.
.
Did you think:
Label paymentMethodLabel = new Label();
....
and then :
container.Controls.Add(paymentMethodLabel);
And if you can explain which option is better and why please.
|