我尝试在asp.net上传文件 我添加两个图像一个是成功,另一个是图像成功上传后失败,然后我显示图像和失败我是如何做到这一点 这是代码
<div><img id="imgsuces" runat="server" src="images/successs.png" visible="false" alt="success" />
<asp:Label runat="server" id="StatusLabel" />
</div>
<div><img id="imgfalied" src="images/failed.png" runat="server" visible="false" alt="success" />
<asp:Label runat="server" id="Label2" />
</div>
<div id="Something" visible="false">
我打电话给标签
StatusLabel.ForeColor = System.Drawing.Color.Green;
//StatusLabel.ForeColor = System.Drawing.FontStyle.Bold;
StatusLabel.Text = "Success";
}
catch
{
StatusLabel.ForeColor = System.Drawing.Color.Red;
Label2.Text = "Failed";
}
答案 0 :(得分:0)
你忘了设置
imgsuces.Visible = true;