Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have a grid that displays an image on page 1 and a button. How do I pass that grid which has the image to another grid that is on my page 2? Anyone can help please?
Posted
Comments
Dinesh.V.Kumar 25-Mar-14 3:39am    
Convert the image as byte array...add it to a session and in the next page get the byte array and assign it to the image source by converting back from the session..


Regards
Alif Marz 25-Mar-14 3:55am    
hmmm I'm kinda new to wpf haha. I'm using wpf browser application. In my page 1 grid, I called a user control. In that user control, I have a grid which has a picture and some textblocks. So I called that grid to my page 1 grid using a code gridDisplay.Children.Add(the grid from user control). So now, once the grid from user control appears on my page 1 grid, I need to display that grid in page 2. I'm kinda lost when u say convert image to byte array haha.
Dinesh.V.Kumar 25-Mar-14 4:43am    
Have a look at the below mentioned link..you might get an idea what I am trying to say
http://www.codeproject.com/Articles/15460/C-Image-to-Byte-Array-and-Byte-Array-to-Image-Conv

Regards

1 solution

Store your image in the cache and the other page you can reach that object.

For example:
C#
//storing page:
Image obj = //your declaration
Cache["yourImage"] = obj;

//other page:
Image obj = Cache["yourImage"] as Image;


You can read about the caching from here[^].

Be aware of storing big object in session, it will be stored in the web server memory.
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900