简体   繁体   English

在表单上看不到我的图片-asp.net

[英]can't see my picture on the form - asp.net

i add Image control to my WebForm. 我将图像控件添加到我的WebForm。

i insert picture to App_Data. 我将图片插入App_Data。

i connect the picture to my Image control in the ImageUrl 我将图片连接到ImageUrl中的Image控件

it seen like this: 它看起来像这样:

<asp:Image ID="Image1" runat="server" Height="94px" 
            ImageUrl="~/App_Data/Tulips.jpg" Width="209px" />

in the design i see this picture, but when i run the project i dont see the picture. 在设计中,我看到了这张图片,但是当我运行项目时,我没有看到图片。

what can be the problem ? 可能是什么问题?

App_Data is a special folder in ASP.NET that only must be used to store data and files that aren't intended to be accessed by end users (ie. via a web browser). App_Data是ASP.NET中的一个特殊文件夹,只能用于存储最终用户不希望访问的数据和文件(例如,通过Web浏览器访问)。 Try to put your picture in another folder, ie. 尝试将图片放在另一个文件夹中。 Images. 图片。

See http://msdn.microsoft.com/en-us/library/ex526337.aspx for more info. 有关更多信息,请参见http://msdn.microsoft.com/en-us/library/ex526337.aspx

I've not tried it, but it's probably because you put the image in the App_Data folder. 我没有尝试过,但这可能是因为您将图像放在App_Data文件夹中。 That's not the appropriate place for it. 那不是适合的地方。 Create an images folder and put it there and try again. 创建一个图像文件夹并将其放在此处,然后重试。

App_Data allows you to use a file-based database that includes SQL Server 2005 and Access, XML files,Excel worksheets or any file-based data store. App_Data允许您使用基于文件的数据库,包括SQL Server 2005和Access,XML文件,Excel工作表或任何基于文件的数据存储。 Create a separate folder in your project and place your image in that folder. 在项目中创建一个单独的文件夹,然后将图像放置在该文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM