Accessing properties in custom control

O

Omid

Hi all,

This is probably a newbie question, but...

I have a custom control inherited from System.Web.UI.WebControls.Table. Here
is the code:

Namespace Test

Public Class PageHeader
`Inherits System.Web.UI.WebControls.Table

Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim tblRow1 As New System.Web.UI.WebControls.TableRow
Dim tblRow2 As New System.Web.UI.WebControls.TableRow
Dim tblRow1Cell1 As New System.Web.UI.WebControls.TableCell
Dim tblRow1Cell2 As New System.Web.UI.WebControls.TableCell
Dim tblRow2Cell1 As New System.Web.UI.WebControls.TableCell
Dim tblRow2Cell2 As New System.Web.UI.WebControls.TableCell

tblRow1Cell1.Controls.Add(New System.Web.UI.LiteralControl("<img
src=/help.gif></img>"))

tblRow1.Cells.Add(tblRow1Cell1)
tblRow1.Cells.Add(tblRow1Cell2)

MyBase.Rows.Add(tblRow1)

End Sub

End Class

End Namespace

When I put <test:pageheader> on my page the table appears, but the border
width is zero. I've tried to change it by calling
"MyBase.BorderWidth.Pixel(1)" but it's not working. Also
"MyBase.Attributes("border")=1". So my question is, PageHeader is derived
from Table web control, so how can I change the border width, cell padding,
border color, ...?

Thanks in advance,
Omid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,890
Messages
2,569,972
Members
46,308
Latest member
DonaldDarr

Latest Threads

Top