如何从其他页面上传上传后,在另一页面的网格视图中显示图像 [英] How to show image in grid view in another page after upload upload from another page

查看:78
本文介绍了如何从其他页面上传上传后,在另一页面的网格视图中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



任何人都有关于如何从一个页面上传图片并在网格视图中显示另一个页面的建议加上相同的上传图片有一些其他属性当我们点击它时它会显示这些功能。

Hi,
any one have suggestion about how to upload image from one page and show in another page in grid view plus the same uploaded image have some other property when we click on it it will show these features.

推荐答案

以下是我的观点



上传图片页面

- >使用FileUpload控件上传图片文件

- >使用SaveAs方法保存文件FileUpload控件

- >将FilePath(已保存文件的位置)和其他有关上传图像的信息插入数据库表



在GridView页面上

- >从您插入数据的数据库表中检索信息并使用GridView Control进行绑定

- >使用模板列GridView中的图像标记用于显示图像。在img标签的src属性中分配图像路径(但是应该是虚拟路径(如http://localhost/abc.png)而不是物理路径(如C:/abc.png)。
Below is my view to do this

On Upload Image Page
->Use FileUpload control for uploading image file
->Save file using SavesAs method of FileUpload control
->Insert FilePath (where you have saved file) and other information about uploaded image into database table

On GridView Page
->Retrieve information from database table where you inserted data and bind with GridView Control
->Use template column with Image tag in GridView to display image. Assign image path in src attribute of img tag (but is should virtual path(like http://localhost/abc.png) not physical path (like C:/abc.png).


这篇关于如何从其他页面上传上传后,在另一页面的网格视图中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆