[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Rob T

1/14/2003 8:53:00 PM

I'm trying to dynamicaly add a button into a table and can't figure out how
to code it. I have no problem doing other controls like TextBox or even
custom controls. When I try to dim it "dim myButton = as new Button()" I
get the little squiggle under Button() which says 'New' cannot be used on a
class that is declared 'MustInherit'

Below is a working snippit of how I would add a TextBox control....shouldn't
a button work the similar way???

Dim ctlBox As New Control()
r = New TableRow()
c = New TableCell() ' Qty Cell
ctlBox = New TextBox()
ctlBox.ID = "boxQty"
c.Controls.Add(ctlBox)
r.Cells.Add(c)


1 Answer

Rob T

1/14/2003 9:23:00 PM

0

I figure it out.... elsewhere in my project I had an .ascx.vb file that had
"Public MustInherit Class Button" in it. It was enough the kill me.

"Rob T" <rtorcellini@NOwalchemSPAM.com> wrote in message
news:#RL0YbAvCHA.2876@TK2MSFTNGP09...
> I'm trying to dynamicaly add a button into a table and can't figure out
how
> to code it. I have no problem doing other controls like TextBox or even
> custom controls. When I try to dim it "dim myButton = as new Button()"
I
> get the little squiggle under Button() which says 'New' cannot be used on
a
> class that is declared 'MustInherit'
>
> Below is a working snippit of how I would add a TextBox
control....shouldn't
> a button work the similar way???
>
> Dim ctlBox As New Control()
> r = New TableRow()
> c = New TableCell() ' Qty Cell
> ctlBox = New TextBox()
> ctlBox.ID = "boxQty"
> c.Controls.Add(ctlBox)
> r.Cells.Add(c)
>
>