473,396 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

using a variable to display the number of images

Hello All

I am not sure if this is the right forum or not so, my apologies before hand
if I am guilty. I have a C# application that has a property retrieving value
(int) from my database. I would like to use this value as the number of
images to dispaly in the page. I have two images (image1.gif and Image2.gif)
in my c:\image folder on my file system. If the value is zero(0) image1.gif
will be displayed; if the value is 1 or greater, image2.gif will be displayed
the number of times the value is equal to. For clarification if the value is
3, three image2.gif files will be displayed on the page. I hope I was clear
about my requirements.

Thanks In Advance for you help on this.
Mar 23 '07 #1
1 1371
I thought this board could use this thread. I got an answer to my question so
here it is for others who may come across this problem.

Thanks both of you, both suggestions help me out a bunch. Actually I placed
the image(s) in a panel contol to respresent a container of sort. Here is my
code if someone else should browse the topic another day.

if (NumberSmileysDisplayed <= 0)
{
Image vImage = new Image();
vImage.ImageUrl = "images/gsmiley.gif";
cFacePanel.Controls.Add(vImage);
}
else
{
for(int i=1;i<=(NumberSmileysDisplayed);i++)
{
Image vImage = new System.Web.UI.WebControls.Image();
vImage.ImageUrl = "images/bfrown.gif";
cFacePanel.Controls.Add(vImage);
}
}

Hope it benefit someone out there!!!!

"kw_uh97" wrote:
Hello All

I am not sure if this is the right forum or not so, my apologies before hand
if I am guilty. I have a C# application that has a property retrieving value
(int) from my database. I would like to use this value as the number of
images to dispaly in the page. I have two images (image1.gif and Image2.gif)
in my c:\image folder on my file system. If the value is zero(0) image1.gif
will be displayed; if the value is 1 or greater, image2.gif will be displayed
the number of times the value is equal to. For clarification if the value is
3, three image2.gif files will be displayed on the page. I hope I was clear
about my requirements.

Thanks In Advance for you help on this.
Mar 23 '07 #2

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

Similar topics

7
by: Ralph Freshour | last post by:
I'm trying to add images to a TEXTAREA tag (in my PHP web page) using the usual image tag: <INPUT TYPE="image" etc. But the images are not showing up in the TEXTAREA but rather outside, below...
0
by: David | last post by:
Please help. I am able to display a folder structure and files but I can't figure out how to add subfolders and maintain the same look. I am a little embarrased but I thought someone out there...
2
by: test | last post by:
hello, i have a question on using javascript with the DOM can anyone help me out i have a function that has a number passed to it the variable is called "bioId" function visible(bioId); this...
4
by: Japhy | last post by:
Hello, I'm am pulling data from a mysql db and want to use the data to populate a <ul. Here are relavent parts of my code : $wohdate = mysql_result($wohRS,$wohndx,woh_date); $woh_display...
0
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to...
7
by: Greg Collins [MVP] | last post by:
Hi, I couldn't find what I was looking for by searching the newsgroup, but perhaps these have already been discussed somewhere. This is a bit long with a lot of interrelated questions. What I've...
1
by: esparkman | last post by:
Hey guys, Kinda stuck in a rut on this one. I'm designing a online stats tracking web app for the game battlefield 2. I want to display the players rank represented by an image. That is in turn...
1
by: bobano | last post by:
Hi everyone, I am writing a POP3 Client program in Perl. You connect to a POP3 Server and have a running conversation with the mail server using commands from the RFC 1939 Post Office Protocol....
29
by: garyusenet | last post by:
I'm trying to investigate the maximum size of different variable types. I'm using INT as my starting variable for exploration. I know that the maximum number that the int variable can take is:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.