Web controls with dynamic child multiplicity

Web controls with dynamic child multiplicity

Post by Kelsang Wangch » Tue, 29 Oct 2002 19:27:35



Hi

I'm building a composite web control that includes a number of
composed child controls with unbounded multiplicity. I'd like to add
"add new thing" and "remove this thing" buttons to my control, to add
and delete composed controls from the control, but I'm not sure how to
go about this.

I was thinking I could keep a count of the number of composed controls
of a particular type in the ViewState, and simply create that many
controls in the CreateChildControls() method of my control. However,
it occurs to me that it would not be possible to delete controls
randomly from these children, since the ViewState for these controls
would become unsyncronised when trying to recreate them.

Is there a standard means of achieving this? I can't find any examples
of dynamic composite controls that create and delete children in this
way. Pointers to examples would be great.

Thanks,

KW

 
 
 

1. catching events for dynamic child controls in a custom web control

Hi everyone,

I'm trying to write the web control outlined below.

I expose two panel controls as properties, <EmailForm> and
<Confirmation>.

The problem I'm having is attaching to the Onclick events of any child
control inside the EmailForm property. (I assume the same problem exists
with the Confirmation Property)

So in other words, the btn1_click function never gets called.

Can any one provide insite?

Thanks,
-Khoi

<script runat="server">
void btn1_Click(Object sender, EventArgs e) {
  Response.Write("testing");
</script>

<DH:WebMailer to="" from="" bcc="" MsgTemplateSrc="" etc...>
  <EmailForm>
    ..Email Form content Goes here
    <asp:Button id="btn1" onclick="btn1_Click" runat="server"
Text="Submit"/>
  </EmailForm>
  <Confirmation>
    ..Email confirmation content goes here
  </Confirmation>
</DH:WebMailer>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

2. Does anyone do demodulation per channel, block, and tree?

3. How to control the Parent Web Page Controls from the Child Web Control

4. GEMULATOR 4.0

5. Dynamic child controls

6. Test

7. DataGrid with dynamic child controls

8. I have o question about linux SMP...

9. Dynamic child controls

10. Web User Controls : how to pass html and child controls parameters

11. Adding a Web Control to a 3rd Party Control (Parent / Child?)

12. Help : LoadPostData for Child Web Controls