Refreshing web control after sub-property change

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Refreshing web control after sub-property change

    I have the following

    A class called PageHeader that derives from WebControl. The PageHeader class defines a property called ForwardButton As ForwardButtonProperties. This ForwardButtonProperties class TypeConvertor is the ExpandableObjectConvertor. I have defined several properties in the ForwardButtonProperties class. These properties all have the NotifyParentProperty(True)attribute.

    Some of these properties affect the generation of the html in the CreateChildControls in the PageHeader class. When a property is changed during the run-time, I want CreateChildControls to be called. The parent property is not notified of the change. What am I missing?

    Bruce Parker Guest

  2. Similar Questions and Discussions

    1. Control Designer change property but does not persist
      Hi All, I'm developing a custom control for ASP.NET (2.0 but this shouldn't matter). I've got a property PageID (Guid) in this control: ...
    2. Web Custom Control, design-time property doesn't change attribute
      Hi, This seems to be a simple problem, but I am unable to figure out what is wrong: I have a Web Custom Control, with two properties (both are...
    3. Detect change in property within control
      Is it possble to have a property like so: <Bindable(True), Category("Appearance"), Description("The help image associated with this control."),...
    4. Refreshing a page to display change in data
      I have a page that scrolls out information from a database. When one of the records has been completed by the user, they press delete at the end of...
    5. can user control change its child control's property using javascript?
      Hi, I place a menu on the user control, and want center the menu based upon client's screen resolution. I try to check the resolution using...
  3. #2

    Default Re: Refreshing web control after sub-property change

    Hi Bruce,

    For a composite control every time you need access to a child control and
    you can't assure it will be already created you need to first call
    EnsureChildControls which will take care of calling CreateChildControls if
    the childs don't exists. Its recommended that you override the Controls
    property get accessor and add a call to EnsureChildControls there before
    returning the controls collection thus making sure that every time anyone
    tries to access the controls by using the controls collection that required
    call is made. In the next version of ASP.NET, there is a new class named
    "CompositeControl" that includes such overload of the Controls property. But
    that won't be available till next year so I think you may opt for coding
    your own ;-)

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    [url]http://obies.com/vga/blog.aspx[/url]
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup

    "Bruce Parker" <anonymous@discussions.microsoft.com> wrote in message
    news:CC704EE7-B352-49EC-BB5A-B939B220446E@microsoft.com...
    > I have the following:
    >
    > A class called PageHeader that derives from WebControl. The PageHeader
    class defines a property called ForwardButton As ForwardButtonProperties.
    This ForwardButtonProperties class TypeConvertor is the
    ExpandableObjectConvertor. I have defined several properties in the
    ForwardButtonProperties class. These properties all have the
    NotifyParentProperty(True)attribute.
    >
    > Some of these properties affect the generation of the html in the
    CreateChildControls in the PageHeader class. When a property is changed
    during the run-time, I want CreateChildControls to be called. The parent
    property is not notified of the change. What am I missing?
    >

    Victor Garcia Aprea [MVP] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139