<table border="0">. Why?

O

Omid

Hi all,

I have a control derived from WebControls.Table, but the output result
always is "<table border="0">". How can I change the border of my derived
control?

Thanks
 
R

Robert Koritnik

Your inherited class also inherits Border-Width property as well all the
others that Table class defines. So all you have to do is to set its
Properties in the control tag.

But If you intend to do anything more "complex" you could make a your own
custom control (derived from WebControl/Control (depends on the
functionality you wish to get) that can be even templated and/or data-bound.
 
O

Omid

Hi Robert,
Thanks for your reply.
My inherited class is defined like this:

Public Class Test
Inherits System.Web.UI.WebControls.Table

So, where exactly I have to set the properties?
 
R

Robert Koritnik

If you want to have some default value it's best to set it in the
constructor, if not just write like this (on the ASPX page that displays
your inherited control):

<someTagPrefix:yourControlsTagName id="whateverItIs" runat="server"
Border-Width="1px" Border-Style="solid" Border-Color="#00000" />

that's how you can set properties on page and would reflect on setting your
control's inherited properties.
 

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,776
Messages
2,569,603
Members
45,194
Latest member
KarriWhitt

Latest Threads

Top