如何在asp.net中将图像从一个页面传输到另一个页面? [英] How to transfer image from one page to other in asp.net?

查看:148
本文介绍了如何在asp.net中将图像从一个页面传输到另一个页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们都知道我们可以将文本值从一个页面传输到另一个页面。我正在使用此方法传输值:



we all know that we can transfer text values from one page to other.. I am using this method to transfer values:

// Session Created
Session["Name"] = txtName.Text; 
Response.Redirect("WebForm5.aspx");

// calling data
if(Session["Name"] != null) 
    Label3.Text = Session["Name"].ToString();





但如何转移图片.. ????



我正在使用数据库处理程序从数据库中检索图像,我希望当用户点击btn时,必须传输图像和数据到另一页..



上面的程序不能用于图像,因为图像不能存储到字符串。



谢谢你



But how to transfer images..????

I am retrieving images from db using handler for a page and i want that when user clicks on a btn the image along with the data must be transferred to another page..

The above procedure don''t work for images as image can''t be store to string.

Thank u

推荐答案

我想这会在这里运作良好..



i think this will work fine here..

// stroing value
 Session["img"] = Image1.ImageUrl;
        Response.Redirect("Default3.aspx")
// calling image
if (Session["img"] != null)
        {
            Image1.ImageUrl =Session["img"].ToString();
        }





请告诉我是否错了



please do tell if its wrong


这篇关于如何在asp.net中将图像从一个页面传输到另一个页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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