Need help with base.Style collection in custom control

N

Nick Goloborodko

Hi,

Here's my situation: I'm developing a custom control, which basically
consists of two nested <DIV> tags. Now, i need to obtain base.Style object,
in order to get the positioning information, if the control is being
positioned via ABSOLUTE positioning.

I have tried to used base.RenderBeginTag() and base.RenderEndTag() but the
the base tag is a <SPAN> an that goes against XHTML formatting rules.

So my question is: how do i either make a base tag s <DIV> tag instead of a
<SPAN>, or how do i obtain a valid inline CSS string from base.Style
preperty? (I tried base.Style.ToString() but that just returns the type of
the object. I also tried foreach loop on the object, but that collection
doesn't have an iterator defined)

TIA
Nick Goloborodko
 
W

Wilco Bauwer

You can derive from WebControl and one of the constructor overloads.
For example:

Code:
....
public MyControl() : base("div") {}
or
public MyControl() : base(HtmlTextWriterTag.Div) {}

HTH.
 
N

Nick Goloborodko

Wilco said:
You can derive from WebControl and one of the constructor overloads.
For example:

Code:
...
public MyControl() : base("div") {}
or
public MyControl() : base(HtmlTextWriterTag.Div) {}

HTH.

Thanks :) You've saved me alot of time :)
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top