闪烁和着色 asp.net 标签控件
我的网络表单上有一个 asp.net 标签控件:
对于这个标签,我从后面的代码设置文本属性:
lblOne.Text = "Number of student is: 86 and Number of teacher is: 7";
现在我想做两件事:
- 闪烁标签。
着色:“学生人数是:”- 红色“86”:- 蓝色
“教师人数是:” - RED & 7:- 蓝色
我该如何做这些事情?
I have a asp.net label control on my webform:
for this label I am setting the text property from code behind:
lblOne.Text = "Number of student is: 86 and Number of teacher is: 7";
Now I want to do 2 things:
- Blinking the label.
Coloring: "Number of student is:" -
RED Color "86" :- BLUE"and Number of teacher is:" - RED & 7:- BLUE
How can I do these things?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您真的确定要让该文本闪烁吗,
标记因某种原因消失:-)
您可以设置 ForeColor 用于标签,但仅适用于完整标签。因此,您可以将该文本拆分为两个标签,一个蓝色,一个红色。
另一种解决方案是使用 Library 并自己设置 html:
Are you really sure you want that text to blink, the
<blink>
tag disappeared for a reason :-)You could set a ForeColor for a label, but only for the complete Label. So what you could do is split that text into two labels, one blue and one red.
A different solution would be to use a Literal and set the html yourself: