Results 1 to 2 of 2

Thread: usercontrol lifecycle

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2001
    Posts
    48

    usercontrol lifecycle

    If I create a usercontrol and place it on a page like so

    <uc:MyTextBox ID="mtb1" runat="server" PROPS="Declarative Set Property" />

    FYI - I've already created the Public Property PROPS get/set...

    My question is this.

    Is there a method that occurs inside a usercontrol that I can override that occurs before the PROPS property is assigned "Declarative Set Property".

    I know it can't be done in New as the textbox inside a usercontrol doesn't exist when the usercontrols new function is fired.

    I also know that PreInit doesn't exist for a user control.

    Thanks in advance

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: usercontrol lifecycle

    In the "get" portion of your PROPS public property, you have the option of executing some logic. For example,

    Code:
    public string PROP
    {
    get
    {
    //do something here
    return myProp;
    }
    set
    {
    //More logic...
    myProp = value;
    }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width