I programmed a WebPart for Sharepoint which allows to set some Properties dynamicly.

The Code of this Webparts is the following:

```
    private void SetValues()
    {
        int counter = 0;
        Control userControl = this.Controls[0];
        for (int i=0; i<userControl.Controls.Count; i++) {
        //foreach (Control element in userControl.Controls) {
            Control element = userControl.Controls[i];
            if (element is Button)
            {
                Button button = (Button)element;
                if (counter < 9)
                {
                    button.Text = _buttonCaptions[counter];
                    element = button;
                }
                counter++;
            }
        }

    }

    #endregion Properties

    #region Methods

    protected override void CreateChildControls()
    {
        Control control = Page.LoadControl(_ascxPath);
        Controls.Add(control);

        SetValues();
    }

```

The Properties are shown in Sharepoint and when editing these Values the "SetValues()"-Method is called. But the Buttontexts do not update until I stop the program and recompile the code. Even a website-reload does not help.

When debugging I can see that "button.Text" is assigned correctly.

Any clue?

[edit]
Thanks to the answer 2 I changed it the following way:

```
 protected override void CreateChildControls()
    {
        Control control = Page.LoadControl(_ascxPath);
        SetValues(control);          
        Controls.Add(control);           
   }

```