asp.net中的图像视图 [英] image view in asp.net

查看:60
本文介绍了asp.net中的图像视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用visual studio的图像组件。我想在用户运行代码时在asp.net页面中显示图像。图像的名称存储在数据库中,根据名称,图像将从给定位置显示。我已经尝试了以下代码,但它无法正常工作..



at aspx

< asp:Image ID =ImgUploadrunat =server/>



at aspx.cs

ImgUpload.ImageUrl = MapPath(@〜/ Photo /+ photo );



其中照片给出了图像的名称。任何帮助...

I am using image component of visual studio. I want to display the image in asp.net page when user runs the code.. the name of the image is stored in database and based on the name, the image is to be displayed from given location. I have tried the following code but it is not working..

at aspx
<asp:Image ID="ImgUpload" runat="server" />

at aspx.cs
ImgUpload.ImageUrl = MapPath(@"~/Photo/" + photo);

where photo gives the name of image. Any help...

推荐答案

是的它是有效的..我已经插入断点并通过将图像打入浏览器来检查它。
yes it is valid.. I have inserted breakpoint and checked for it by taking the imageurl into browser.

这篇关于asp.net中的图像视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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