Wrox Programmer Forums
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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 August 4th, 2011, 07:57 AM
Registered User
 
Join Date: Apr 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Binary Image

I have stored binary image in the SQL database and its fine but when I retreive it using

Response.ContentType = "image/jpeg";
Response.BinaryWrite((byte[])myReader["binary_photo"]);

the image displays but before master page there is certain display probably the binary image like

"����JFIF``��fExifMM* 2�;�GFGI?����i���B� z�2009:03:12 13:48:39David NadalinMicrosoft Corporation�0221��,��02��02� �2008:02:07 11:33:112008:02:07 11:33:11David Nadalin�� �http://ns.adobe.com/xap/1.0/ 42008-02-07T11:33:11.02063Microsoft Corporation David Nadalin ��C ��C ��" �� ���}!1AQa"q2���#B��R��$3 br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz �������������������������������������������������� �������������������������  ���w!1AQaq"2�B���� #3R�br� $4�"

Any help would be appreciated and detailed description would be better
 
Old August 4th, 2011, 12:28 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Can you show us the rest of the code for the page that write out the image? You can't mix HTML and the image so that might be the reason for this problem. Within a page you need to use an img element and link it to a page that outputs just the image and nothing else.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 7th, 2011, 04:27 AM
Registered User
 
Join Date: Apr 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ya solved it using using generic handler to display image in specified location using
Image1.ImageUrl = "~/Showimage.ashx?id=" + Request.QueryString["student_id"];

thanks for your response :-)





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert image to binary form deardp Python 0 September 26th, 2007 11:12 PM
How to convert binary data to image format mshiva Visual Studio 2005 1 February 9th, 2007 10:00 AM
Javascript and binary image data thenoseknows ASP.NET 2.0 Professional 0 January 8th, 2007 07:26 PM
how to convert black & white image into binary? auxiora_nemesis PHP How-To 1 July 27th, 2004 11:09 PM
Read Image and Convert to Binary... soccers_guy10 Pro VB.NET 2002/2003 1 September 22nd, 2003 10:03 AM





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