Keith,
I wanted to avoid doing that (pre-adding the controls and make them invisible), that's why I asked a similar question earlier this week about programmatically adding UserControls. I have several UserControls (each containing many controls) to add that way however and didn't want the overhead of having them all exist on the form (invisibly) when I only needed one at a time. I guess if you have only one group of controls that's going to show itself, then it's probably fine to do it this way and it works just fine (and I think you should also follow Cathi's suggestions).
~~Bonnie
>I would like to implement a web form that will display a textbox and submit button that looks up an "account number". When the user types the account number and clicks submit, I want to expand the form to include more controls.
>
>My plan is to create the form with all of the possible controls and set them to visible=False. Then when the user inputs a valid account number, set them to visible=True in the submit button's click event.
>
>My understanding is that the click event fires after the page is posted back but before the HTML is sent to the browser. Is this the best way to code this? Will I be able to set the visible property in the click event, or does it have to be moved to the page's load event? If it has to be moved, how can I examine the button's commandname and commandargument properties in the page load event?