Regarding custom controls - To add align property to label.

S

swapna_munukoti

Hi all,

I am new to asp.net. So, may be my question may be simple. But I am
feeling hard to achieve this.
I need to create a web custom label control, for which I have to
assign new property called "Align". It should have center,left and
right alignments.
I have created a label with this property and set that to textalign.
But it doesnt have center alignment. How can I get center alignment?

And pls tell me as to how to associate that property to the control.

Thanks in advance..
 
C

Cowboy \(Gregory A. Beamer\)

Try using CSS or inline styles to set the alignment. The style in question
is text-align.

If the label fails, as it renders to SPAN (should not, but if), switch to a
Panel control, add a LiteralControl to its Controls property, for the text,
and apply the text-align. Panel renders to DIV, which I am certain can
center align. Try option 1 first.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top