开发者

Displaying image on a different page

开发者 https://www.devze.com 2023-02-28 19:54 出处:网络
Hallo there I have and imageField as part of a gridview and would like to know how I can view this image in a different page when I select the row with a button(field).

Hallo there

I have and imageField as part of a gridview and would like to know how I can view this image in a different page when I select the row with a button(field). When I add the information to a database the imageUrl is added to the database and this I tie up with the name of an uploaded image and subsequently the image is displayed in the gridview. Is it possible for m开发者_运维问答e to display this image on a different web page as well

thanks


Instead of storing image in session, why not populate Session["ImageID"] value on Button click? Set gridview's OnRowCommand property to a method that will set Session["ImageID"] to the current row's DataKey, then do a redirect to that other page that will get value from Session["ImageID"] and get image URL for that ID from database. Don't forget to also perform Session.Remove("ImageID"). That way you'll keep your session object as small as possible.


Yes ,you can , i think if you store the selected image information in a Session.May be, there are other ways , but the first thing comes in my mind in this case using the session.

0

精彩评论

暂无评论...
验证码 换一张
取 消