如何在不使用ASP.NET数据库的情况下在gridview中上传和显示图像?

如何在不使用ASP.NET数据库的情况下在gridview中上传和显示图像?

问题描述:

如何在不使用asp.net数据库的情况下在gridview中上传和显示图像?



我想在gridview中显示图像通过使用文件上传控件,但图像不存储在数据库中。只是图像立即显示在网格视图屏幕上。



我尝试过:



我想通过使用文件上传控件在gridview中显示图像,但图像不存储在数据库中。只是图像立即显示在网格视图上screen。

How to upload and display image in gridview without using database in asp.net?

I want to display an image in gridview by using file upload control but the image is not store in database.Just the image is displayed instantly on grid view screen.

What I have tried:

I want to display an image in gridview by using file upload control but the image is not store in database.Just the image is displayed instantly on grid view screen.

您不需要数据库来上传和获取图像。您可以将图像上传到任何位置,例如文件系统,现在您正在使用的ASP.NET将帮助我们减少搜索量,但是可以在此处阅读一般的ASP.NET文件上载文章,使用ASP.NET上传文件 [ ^ ]。



您可以存储图像URL,用于存储图像的位置,然后使用它来创建GridView的Uri映射以渲染图像。



在Gridview中动态设置图像URL ASP.NET论坛 [ ^ ]

如何在gridview中设置图片网址 [ ^ ]
You do not need a database to upload and fetch the image. You can upload the image anywhere, like a file system, now which ASP.NET you are using is going to help us trim the search down a bit, but general ASP.NET File Upload article can be read here, File Upload with ASP.NET[^].

You can store the image URL, for the location where the image is stored and then use that to create a Uri mapping for the GridView to render an image.

Dynamically setting image url in Gridview | The ASP.NET Forums[^]
how to set image url in gridview[^]