Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 18th, 2004, 02:50 PM
Registered User
 
Join Date: Jan 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datagrid for display images

I am still fairly new to this process. But, I am looking for samples of using the data grid to display thumbnail images; specifically, I am retunring data from an Access database table. I want to show a list of company names and a thumbnail logo (probably a gif or tif).

 
Old January 18th, 2004, 03:04 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You'll need to create a new aspx page that feeds the image. You can't output image binary data directly to the page, you can only provide a URL for the image. So you would need to provide an image url that looks likes this:

companylogo.aspx?companyID=123

Inside of companylogo.aspx you will have to read the database again and extract the binary data, then write it out to the page using BinaryWrite(). Here's a snippit from a page I use that does this:

Response.Clear()
Response.ContentType = "image/jpeg"
Response.BinaryWrite(objStream.ToArray)
Response.Flush()

objStream is a memory stream object that I'm creating from multiple source, but non of which are a database so I can't provide much help with doing that specific piece.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Display images from lightbox kumiko Classic ASP Basics 2 February 25th, 2008 10:19 PM
How To Display Images in DataList abdul_owiusa General .NET 1 May 20th, 2005 09:01 AM
how to display images ? shirley65 C# 2 May 31st, 2004 08:12 AM
Datagrid to display thumbnail images [email protected] VB.NET 3 January 19th, 2004 01:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.