0
我正在開發一個asp.net web應用程序使用web數據庫的形式。在我的應用程序已存儲的圖像文件夾中,併爲圖片鏈接存儲在數據庫中 我希望通過採取這些鏈接從數據庫 顯示這些圖片我嘗試了以下代碼來顯示圖像如何顯示數據庫所採取的鏈接圖像
home.aspx的.cs
protected void Page_Load(object sender, EventArgs e)
{
profile_picture = (string)(Session["link"]); //link has been taken from db
}
home.aspx
<asp:Image runat="server" ID="profile_picture" ImageUrl="Label"></asp:Image>
錯誤是=>錯誤4無法隱式轉換類型 '字符串' 到 'System.Web.UI.WebControls.Image' 如何解決? 謝謝。