473,782 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Put a binary image into HtmlGenericCont rol

Hi,

I have in a database models of cars,

CarID int
CarName varchar
CarFeatures varchar
CarImage binary

I have a class Car that have the properties:
ID int
Name string
Features string
Image byte[]

My problem starts here:

i have into a page a

<span id=CarGenericCo ntrol runat=server>

and inside CarGenericContr ol.InnerHtml i have to show the Name, Features,
and Image foto of the car.

In this moment i show all the information except the foto, that i dont know
how to put it from byte[] into the Generic Control.

Do you have any advice for this specific case?

--
Thanks
Regards.
Josema
Nov 16 '05 #1
3 2405
Josema,

You need to create a bytearray in a page and than do in that page
Response.Binary Write(arrImage) ;

That page do you reference in your image.ImageUrl =
UrlFromMyCreate dBitmapPage;

I hope this helps?

Cor
Nov 16 '05 #2
Hi Cor, first of all thanks for your early response.

Actually i have a byte array with the image loaded from binary field
(database).

My problem is based on:

1) have all the info to show (the image into a byte array, and all the rest
of the data that comes from database, varchar, etc...). But i only can use a
page to display all this data. And all this data i have to show into a
HtmlGenericCont rol.
Actually i dont have problems to show tha string data. but im trying to put
into the property InnerHtml the byte[] variable to show the image, but
without success.

Any help would be appreciated.
Thanks Cor.
Regards.
josema.

"Cor Ligthert" wrote:
Josema,

You need to create a bytearray in a page and than do in that page
Response.Binary Write(arrImage) ;

That page do you reference in your image.ImageUrl =
UrlFromMyCreate dBitmapPage;

I hope this helps?

Cor

Nov 16 '05 #3
Josema,

I have seen a lot of people trying what you want to do (including me),
however AFAIK is it only possible to show the image using an imagebox (or
any other special object made for it as from macromedio).

However you never know that we both see an answer in half an hour.

Cor
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
9720
by: Maurizio Penna | last post by:
I, guys. I've embeded an image into a xml file, something like that: <display type="picture" mime="image/png" name = "mosaico6.png"> <!]> </display> Now, I want to display it with a XSL Transformation, but my code don't work: <display>
6
2648
by: C K | last post by:
What is less expensive/intensive on the server -dynamically writing out my rollovers to an asp:literal, or to use asp:image tags for the images. My image names will be dynamic as I am building a multi-lingual site (french/english). Any advice would be appreciated - if there is better way to do this I'd be open to it as well. TIA Clayton
0
283
by: VB Programmer | last post by:
I have 2 webforms. When I print out the page.Controls(1).tostring variable one says "HtmlForm", the other "HtmlGenericControl". How can I change the first one to "HtmlForm"? ? page.Controls(1).tostring "System.Web.UI.HtmlControls.HtmlForm" ? page.Controls(1).tostring "System.Web.UI.HtmlControls.HtmlGenericControl"
3
3488
by: Arun | last post by:
Hi, I have simple question to ask. How to write multiple Binary files to the Browser using Asp.Net and Visual C#.net I have seen examples where single binary file is written to browser. -Regards Arun
4
3444
by: qualitynice | last post by:
HELP :-)... I'm creating an embedded activex object in an asp.net page using the HtmlGenericControl class. I'm doing this because when I tried to embed it directly in the aspx page, it stopped working once I changed it to run on the server (runat="server"). It said the GUID was wrong. I found code showing how to implement an activex control using the HtmlGenericControl class from the code behind file, but I can't figure out how to call...
8
2952
by: Randall Parker | last post by:
I want to generate an HTML tag that will look like: <a href="EquipmentServiceCreate.aspx?serial=X01">Create New Service For X01</a> or on a different instance where the user would be viewing "X05" it would looke like: <a href="EquipmentServiceCreate.aspx?serial=X05">Create New Service For X05</a> I'm trynig to figure out how to do that using HtmlGenericControl in C# code behind.
4
2402
by: Beginner | last post by:
How do I convert JPEG images to binary files in ASP.NET? Please advice. Thanks.
2
10097
by: Rik Brooks | last post by:
I have a web page that has a placeholder on it called PlaceHolderText. I read some html out of the database. The value for my test is: this is <strong>a test </strongof the html stuff I read that into a variable that I call htmlData (it's a string) htmlData = reader.ToString(); Then, after making sure that htmlData is good and all, I do the following
6
4344
by: aznimah | last post by:
hi, i'm work on image comparison. i'm using the similarity measurement which i need to: 1) convert the image into the binary form since the algorithm that i've use works with binary data for the computation 2) compare the string binary data to get the similarity or dissimilarity result. The problem is, i already done with the image (jpg) conversion to binary and also try the algorithm structure in C# language, but i having a problem to...
0
9639
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9939
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7486
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4040
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2870
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.