Thursday, March 22, 2012

Text-based controls: Formatting as inline elements

I have had a question that I have been avoiding or using workarounds for for
a while. When using text-based controls (Labels, HyperLinks displayed as
text, LinkButtons, etc.), how do I format certain parts differently? For
example, I might have a set of instructions that I want keywords displayed
in a different color, or there might be a certain word that I want to
display as a link. When the text is all on the same line, I can simply place
the controls next to each other. But when the text will need to wrap to the
next line, this causes a problem. It is also rather tedious to use so many
controls just for a few links. Does anyone know of an efficient solution to
this problem? Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/How about using javascript to perform global replace on document.InnerHtml
at onload event? I've not tested it but I think it should work.
"Nathan Sokalski" <njsokalski@.hotmail.com> glsD:ut$GsMXvFHA.4032@.TK2MSFTNGP15.phx
.gbl...
>I have had a question that I have been avoiding or using workarounds for
>for a while. When using text-based controls (Labels, HyperLinks displayed
>as text, LinkButtons, etc.), how do I format certain parts differently? For
>example, I might have a set of instructions that I want keywords displayed
>in a different color, or there might be a certain word that I want to
>display as a link. When the text is all on the same line, I can simply
>place the controls next to each other. But when the text will need to wrap
>to the next line, this causes a problem. It is also rather tedious to use
>so many controls just for a few links. Does anyone know of an efficient
>solution to this problem? Thanks.
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
>

0 comments:

Post a Comment