在asp.net中动态创建文件uploder动态保存图像 [英] save image dynamically from dynamically created file uploder in asp.net

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

问题描述

我动态创建了文件上传控制器并将图像保存到数据库。

之后我想在用户想要编辑记录时显示该图像。

i had created file upload controller dynamically and save image to the database.
after that i want to display that image when user want to edit record.

推荐答案

foreach(控制ctrl in placeHolder.Controls)

{

if(ctrl is FileUpload)

{

FileUpload fUl =(FileUpload)ctrl;

postedFile.Add(fUl.ID,new byte [fUl.PostedFile.ContentLength]);

}

}



之后我用IDictionary添加该文件,但问题是我无法建立逻辑来检索图像来自数据库。
foreach (Control ctrl in placeHolder.Controls)
{
if (ctrl is FileUpload)
{
FileUpload fUl = (FileUpload)ctrl;
postedFile.Add(fUl.ID, new byte[fUl.PostedFile.ContentLength]);
}
}

after that i add that file with IDictionary but the problem is that i am not able to establish a logic to retrieve the image from database.


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

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