如何在 ASP.net (VB) 中将图像添加到标签
How to add image to label in ASP.net (VB)
我想根据这样的条件在 aspx 网页的标签中显示向上箭头和向下箭头
If successrate > x Then
result = "upArrow"
ElseIf successrate < x Then
result = "Down"
Else : result = "sameArrow"
End If
我有一个想法使用这种方法在 windows 表单中实现但不知道如何在网页中实现这个请告诉我有没有办法显示向上和向下箭头或帮助我改变此代码在网页
Private Sub upArrow()
img = Image.FromFile("C:\upArrow.jpg")
Label1.Image = img
End Sub
根据 MSDN,您必须将标签的大小设置为图像的大小才能正确显示。
Private Sub upArrow()
img = Image.FromFile("C:\upArrow.jpg")
Label1.Size = img.Size
Label1.Image = img
End Sub
将 Html "img" 元素添加到 ASP.net 标签的文本 属性 中,如下所示。有效。
string imagePath = "http://localhost:51746/WebSite1/Tulips.jpg";
Label1.Text = string.Format("<img src='{0}' style='height:100px;width:100px;'/>", imagePath);
我想根据这样的条件在 aspx 网页的标签中显示向上箭头和向下箭头
If successrate > x Then
result = "upArrow"
ElseIf successrate < x Then
result = "Down"
Else : result = "sameArrow"
End If
我有一个想法使用这种方法在 windows 表单中实现但不知道如何在网页中实现这个请告诉我有没有办法显示向上和向下箭头或帮助我改变此代码在网页
Private Sub upArrow()
img = Image.FromFile("C:\upArrow.jpg")
Label1.Image = img
End Sub
根据 MSDN,您必须将标签的大小设置为图像的大小才能正确显示。
Private Sub upArrow()
img = Image.FromFile("C:\upArrow.jpg")
Label1.Size = img.Size
Label1.Image = img
End Sub
将 Html "img" 元素添加到 ASP.net 标签的文本 属性 中,如下所示。有效。
string imagePath = "http://localhost:51746/WebSite1/Tulips.jpg";
Label1.Text = string.Format("<img src='{0}' style='height:100px;width:100px;'/>", imagePath);