time, it works. I'm guessing it either didn't like the spaces or the ":" in
the ID. At least it works. thanks for the suggestions!
> Bishop,
> If you can post a complete code sample that exhibits this behavior, it
> may be more obvious. Get rid of all code that isn't relevant to the
problem
> at hand.
>
> Best regards,
> Jeffrey Palermo
>
> "Bishop" <kwayne@new.rr.com> wrote in message
> news:OhGIzG30EHA.2676@TK2MSFTNGP12.phx.gbl...
> > Thanks for the advice.
> >
> > The dates are pulled from a DB and are always going to be the same.
> >
> > I tried moving the properties after adding the control but didn't make
any
> > difference.
> >
> >
> >
> >
> > "Jeffrey Palermo [MCP]" <
http://dotnetjunkies.com/weblog/jpalermo> wrote
> in
> > message news:%23pReD920EHA.804@TK2MSFTNGP12.phx.gbl...
> > > Bishop,
> > > The thing that stands out to me is that you are setting the Button
> ID
> > to
> > > a date? This is probably changing from postback to postback. Events
> are
> > > wired up based on the uniqueID of each control, so this must remain
the
> > same
> > > from postback to postback. Another thing I see wrong is that you are
> > > setting properties before you add the control to the page. You should
> add
> > > the control to the page (or table cell) before you set any properties.
> > >
> > > Best regards,
> > > Jeffrey Palermo
> > >
> > > "Bishop" <kwayne@new.rr.com> wrote in message
> > > news:%23%23WDnw20EHA.3840@tk2msftngp13.phx.gbl...
> > > > I can't get my button event to fire inside a table. the button
> outside
> > of
> > > > the table works. Both make a postback.
> > > >
> > > > Any help appreciated.
> > > >
> > > > My code below.
> > > >
> > > >
> > > > (Add button to page)
> > > >
> > > > Dim myButton As New Button
> > > >
> > > > myButton.ID = ButtonID.ToString
> > > >
> > > > myButton.Text = "Save"
> > > >
> > > > Page.FindControl("FORM1").Controls.Add(myButton)
> > > >
> > > > AddHandler myButton.Click, AddressOf btnAdd_Click
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > (Add button to table cell)
> > > >
> > > > Dim myButton As New System.Web.UI.WebControls.Button
> > > >
> > > > myButton.ID = myDate.ToShortTimeString
> > > >
> > > > myButton.Text = myDate.ToShortTimeString
> > > >
> > > > myCell1.Controls.Add(myButton)
> > > >
> > > > AddHandler myButton.Click, AddressOf btnAdd_Click
> > > >
> > > >
> > > >
> > > > (Event)
> > > >
> > > > Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
> > > > System.EventArgs)
> > > >
> > > > Dim myButton As Button
> > > >
> > > > myButton = CType(sender, Button)
> > > >
> > > > Dim myTemp As String = myButton.ID
> > > >
> > > > End Sub
> > > >
> > > >
> > >
> > >
> >
> >
>
>