Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Refreshing web control after sub-property change

Reply
Thread Tools

Refreshing web control after sub-property change

 
 
Bruce Parker
Guest
Posts: n/a
 
      04-27-2004
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?

 
Reply With Quote
 
 
 
 
Victor Garcia Aprea [MVP]
Guest
Posts: n/a
 
      04-28-2004
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:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup

"Bruce Parker" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Self-refreshing and non-self-refreshing controls Harlan Messinger ASP .Net 1 08-04-2006 01:13 PM
Self-refreshing and non-self-refreshing controls Harlan Messinger ASP .Net Web Controls 0 08-03-2006 12:29 PM
Refreshing web-control in designer hammad.awan_nospam@gmail.com ASP .Net Web Controls 1 05-25-2006 05:21 PM
Self refreshing user control/custom control. Jensen Bredal ASP .Net 5 12-29-2004 12:10 PM
refreshing main window after editing in popup Konrad R. ASP .Net 2 08-07-2003 10:20 PM



Advertisments