如何在AspxImage中显示图像?

时间:2022-02-23 21:18:53

I want to show image by selecting it from Documents folder in my PC in desktop.

我想通过在桌面PC中的Documents文件夹中选择它来显示图像。

I am writing:

我在写信:

 ASPxImage1.ImageUrl = "C:\\Documents\\Pictures\\AspxImage.png";

But this is not showing anything. How to show this image?

但这并没有显示任何东西。如何显示这张图片?

1 个解决方案

#1


2  

Problem : Web Applications does not have the permissions to access the Local Drives of the client machines due to security concerns.

问题:出于安全考虑,Web应用程序无权访问客户端计算机的本地驱动器。

Solution : you need to create a folder called Images in your project folder and access it using relative path.

解决方案:您需要在项目文件夹中创建一个名为Images的文件夹,并使用相对路径访问它。

Try This:

尝试这个:

ASPxImage1.ImageUrl = Server.MapPath("~/Images/AspxImage.png");

#1


2  

Problem : Web Applications does not have the permissions to access the Local Drives of the client machines due to security concerns.

问题:出于安全考虑,Web应用程序无权访问客户端计算机的本地驱动器。

Solution : you need to create a folder called Images in your project folder and access it using relative path.

解决方案:您需要在项目文件夹中创建一个名为Images的文件夹,并使用相对路径访问它。

Try This:

尝试这个:

ASPxImage1.ImageUrl = Server.MapPath("~/Images/AspxImage.png");