c# - How to highlight or change the color of some words in a label dynamically at runtime? -
I have a label with some text and I do not want to highlight or change the color of some words in the text of the label Not all words It should be dynamic any suggestion?
This is for C # with ASP.NET, which is under user control in the shareholders in the webpap
On the server-side, you can embed some HTML into the text of your label (VB):
myLabel.Text = "some general text < Span style = 'color: red;' & gt; some red text
This is the basic system, but 'dynamic' means many things here. It is possible. If you post some more information about what you are actually doing, then I can probably help you more. Another thought: As Rob Allen pointed out, Little Control might have a better option in this situation since it is intended to emit raw HTML, while the labels wrap the text in the interval so that The whole thing can be easily formatted.
For more information see this:
For the record, I think a label can actually be fine.
Comments
Post a Comment