ton, Can you explain that again. Its not very clear what you want to do ;P
"ton" <vrs@home.nl> wrote in message
news:bvl8va$khs$1@news3.tilbu1.nb.home.nl...
> thank you
> the event is fired now but what I had in my does not occur:
> What I do is the following:
> - I show a record contains of 10 fields. The properties are:
> Tablename, RecordID, ShowFields (just a list of the fields to show)
> now pressing a button should replace the existing recordcard by another
> record card. For example a record contains a Contact. One of the field is
> the (database)-link to the Customer. To click on that buttonlink, should
> replace the form with for example 10 fields of the customer. You can say
it
> is a zoom function to the toplevel of the database.
> For me this is inportant because it let me navigate in the database.
> Another example:
> when I want to modify the link I want to replace the control with a search
> screen to show a list of customers, where the user can select one. Or to
add
> a complete knew one.
>
> The question is: "Is this possible". I do not want the webdesigner to add
> several controls on the form or to add several forms to the project to
> handle these evenst.
>
> Ton
>
>
> "Alessandro Zifiglio" <alessandrozifiglio@NO-SPAM-hotmail.com> schreef in
> bericht news:PZpSb.1500$HO2.700@news.edisontel.com...
> > oops, no workaround. That InamingContainer Interface had me a little
> > confused ;P
> > Since this interface already makes control ids unique you just need to
> pass
> > your id as is like
> >
> > button1.id = "button1"
> > textbox1.id = "textbox1"
> > and so forth.
> > When trying to reference textbox1 for example just simply use its id
> > "Alessandro Zifiglio" <alessandrozifiglio@NO-SPAM-hotmail.com> wrote in
> > message news:cmpSb.1494$HO2.558@news.edisontel.com...
> > > ton, Look at the post "No events are fired in child controls". Jeffery
> has
> > > just pointed out how useful Implementing the InamingContainer
interface
> > > really is, especially when you need events in child controls routed.
> This
> > is
> > > why your events werent firing.
> > >
> > > Iimplement this interface, and do not try passing an explicit id to
your
> > > control if you dont need it.
> > >
> > > At the moment i myself am having problems passing an explict id to
child
> > > controls and i'm working on a workaround. Will postback when I do find
a
> > > way. One good reason to want to pass an explicit id is when using a
> > > validator control and as you already know you need to pass your
controls
> > id
> > > to its "controlToValidate" property.
> > >
> > > If this is not your case then i dont see why it is important to pass
an
> > > explicit ID
> > >
> > > "Alessandro Zifiglio" <alessandrozifiglio@NO-SPAM-hotmail.com> wrote
in
> > > message news:ZeeSb.1334$HO2.690@news.edisontel.com...
> > > > Should fire. It works for me. However i have noticed that you are
> trying
> > > to
> > > > add controls in your button click. This will not work for you
because
> > > during
> > > > postback those controls wont be recreated. so set a flag in
viewstate
> as
> > > you
> > > > add the control.
> > > > Also I have noticed that you are trying to retrieve the same button,
> the
> > > one
> > > > that fired the event in its event click and add it to the controls
> > > > collection. This is not what what you need to do, but simply have
the
> > same
> > > > code run after postback. Whatever code you have in your
> > > createchildcontrols
> > > > method will run after postback, so let it all run as is and remove
the
> > > > ispostback check in there --If that code is not run your event will
> > never
> > > > fire, this is because the viewstate of the control is restored when
> the
> > > > control is reloaded into its container.
> > > >
> > > > Private Sub ButtonClick(ByVal sender As Object, ByVal e As
> > > System.EventArgs)
> > > > Dim MyButton As New Button()
> > > > MyButton = CType(sender, Button)
> > > > context.response.write("Click event for " & MyButton.id & "Fired")
> > > > End Sub
> > > >
> > > >
> > >
> >
>
http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition2.src&file=VB\Composition2.vb&font=3
> > > >
> > > > This is another example :
> > > >
> > >
> >
>
http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition3.src&file=VB\Composition3.vb&font=3
> > > >
> > > >
> > > > "ton" <vrs@home.nl> wrote in message
> > > > news:bvboj3$gbo$1@news1.tilbu1.nb.home.nl...
> > > > > Thanks for you reply
> > > > >
> > > > > I've used the code you've send me. It did not work. I made my
> control
> > a
> > > > lot
> > > > > simpeler and the result was the same.
> > > > > It looked as if the button click event were not handled by te
> > procedure
> > > of
> > > > > the addresoff statement:
> > > > >
> > > > > The code looks now like: (And I'm sure that the
createchildcontrols
> is
> > > > > called instaed of the the buttonclick procedure)
> > > > >
> > > > > Protected Overrides Sub CreateChildControls()
> > > > > If Me.Page.IsPostBack Then ' this is what runs after the button
> click
> > > > > ''Exit Sub '' (if I use Exit sub, no control is displayed)
> > > > >
> > > > > End If
> > > > >
> > > > > But = New Button
> > > > >
> > > > > But.Text = "Submit"
> > > > >
> > > > > But.ID = ClientID & "X"
> > > > >
> > > > > Controls.Add(But)
> > > > >
> > > > > AddHandler But.Click, AddressOf Me.ButtonClick
> > > > >
> > > > > ChildControlsCreated = True
> > > > >
> > > > > end Sub
> > > > >
> > > > > Private Sub ButtonClick(ByVal sender As Object, ByVal e As
> > > > System.EventArgs)
> > > > >
> > > > > But = FindControl(ClientID & "X")
> > > > >
> > > > > But.Text = "xxxx"
> > > > >
> > > > > Controls.Add(But)
> > > > >
> > > > > End Sub
> > > > >
> > > > > I've dimensioned the button But as a private control, did not help
> > > > > íve done this with the withevents keyword, no difference
> > > > > and i've dimensioned them in the procedures createchildrecords and
> > > > > buttonclick
> > > > >
> > > > > no differences
> > > > >
> > > > > Ton
> > > > >
> > > > > "Alessandro Zifiglio" <alessandrozifiglio@NO-SPAM-hotmail.com>
> schreef
> > > in
> > > > > bericht news:9DbSb.1271$HO2.677@news.edisontel.com...
> > > > > > ton,
> > > > > > what do you want to do with the caputred event ?
> > > > > > If all you need to do is capture it and take action in your
> control
> > > > itself
> > > > > > then you can easily do this :
> > > > > > 1.In createchildcontrols as you add your control that posts
back,
> a
> > > > button
> > > > > > control for example :
> > > > > > Dim button1 As New Button()
> > > > > > button1.Text = "Submit"