.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

CheckListBox - Display images selected

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :ASP.Net

I am trying to display all images selected in a checklistbox, but am not sure how to write the c#.

Any help would be great.


<%@ Page language="c#" Inherits="GreetingCardMaker.GreetingCardMaker" CodeFile="NewGreetingCardMaker.aspx.cs" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html xmlns="http://www.w3.org/1999/xhtml">
		<title>Greeting Card Maker</title>
		<form runat="server">
			<div style="BORDER-RIGHT: thin ridge; PADDING-RIGHT: 20px; BORDER-TOP: thin ridge; PADDING-LEFT: 20px; FONT-SIZE: x-small; PADDING-BOTTOM: 20px; BORDER-LEFT: thin ridge; WIDTH: 293px; PADDING-TOP: 20px; BORDER-BOTTOM: thin ridge; FONT-FAMILY: Verdana; BACKGROUND-COLOR: lightyellow">Choose 
				a background color:<br />
				<asp:DropDownList id="lstBackColor" Height="22px" Width="194px" runat="server" 

View Complete Post

More Related Resource Links

Store and Display Images from MS Access Database Using C#

There is only the difference of coding syntax to stream the binary data of image content type to upload it into MS Access Database using C#/VB in ASP.Net 2.0

Namespaces required:-
using System.Data.OleDb;

OleDb is used to connect the web site forms with MS Access Database using Microsoft.Jet.OLEDB.4.0

how can i display the selected value of dropdownlist from edittemplate to label from itemtemplate?


I have a detailsview with a dropdownlist in it. the detailsview is connected to a database table(employees having the following fields: id-smallint,name-nvarchar, departmnet-smallint). the ddl is connected to another table (departments with the following fields: id-smallint, departmentName-nvarchar). the ddl is in the edititemTempalte of the department field. My goal is to display in  the itemtemplate the departmentName (the selected value from the edititemtemplate ). How can I do this? Doyou have any ideas?

thanks a lot

SSRS 2005 external images won't display - images on DIFFERENT file server

Hi, Been having trouble getting external images to display in reports rendered on SSRS 2005. Images are displayed as a red X. However, my scenario is different from some of the examples I have read about. - The images are stored on a file server that is DIFFERENT from the box on which the Report Service is running. For various business reasons I cannot copy the images locally to the Report Service box. I am using "file://fileserver/path/to/image.jpg" to retrieve the images. - Since the file server does not have IIS installed, I cannot access the images using the URL method (http:// access). I need to use the file:// method. Currently I am prototyping this setup on my test box, which is running XP Pro and IIS 5.1. The Report Service is installed on this same box. I am currently testing this through the Report Manager web site (http://servername/Reports). The images are displayed using the Image control, which I added to the report using the visual report designer in Visual Studio 2005. It is set up with source=External and with "file://fileserver/path/to/image.jpg" path values. File names are retrieved from our database and file paths are built dynamically using a data processing extension I have written. My best guess as to why this is happening is that the ASPNET service account on my test box does not have access to the particular share on the file serve

How to display images with label object

HelloI want to display image with asp:label, I also want to display message in two lines in which first line with 12 pt size and second line with 11 pt.I am using asp.net with C#.Please adviseAvi

MultiColumn Combo Box Does not display selected value

Hi, I have a WPF MultiColumn Combo Box in a WPF DataGrid Code :     <my:DataGridComboBoxColumn Header="Address" Width="200" x:Name="dgColContactAddr"   SelectedValuePath="CompleteAddr">       <my:DataGridComboBoxColumn.EditingElementStyle>     <Style x:Name="styel1" TargetType="{x:Type ComboBox}">     <Setter Property="ItemsControl.ItemTemplate" >     <Setter.Value>     <DataTemplate>     <StackPanel Orientation="Horizontal">     <TextBlock Text="{Binding Path=Address1}" />     <TextBlock Text=" "/>     <TextBlock Text="{Binding Path=Address2}"/>     <TextBlock Text=", "/>     <TextBlock Text="{Binding Path=City}"/>     <TextBlock Text=", "/>     <TextBlock Text="{Binding Path=State}"/>     <TextBlock Text=", "/>     <TextBlock Text="{Binding Path=Country}"/>     </StackPanel>     </DataTemplate>       </Setter.Value>

Display Images from a Custom List's Attachment Field

i need to show each item on the list with image that was uploaded to its attachments field. the idea is that this list is a news list and will be show as a grid with the news and their corresponding attached image. i tried to add a custom column of type Picture, but it only allows to have a hyperlink added. i need the ability to upload the image on a new item creation form.   if there is a way to display it that would be great, if not please recommend a way to accomblish what i have explained.     thanks  

How to display images?

I have class Item with properties Id & ImageFileName.   Controller: public ActionResult Index() { ViewData.Model = (IEnumerable)GeItems(); return View(); } View:Create strongly typed view of Item class. How can I display Image from file system?<img src="images/<%= model => model. ImageFileName %>" alt="Image"/> this line gives me the error:  Cannot convert lambda expression to type 'char' because it is not a delegate type    

Dynamically display images based on a variable - JavaScript

I am trying to bring in a specific image based on a variable brought into the page with a querystring. I initially thought having an array with the image's URL in it would work, but I am having problems associating the array index with the variable. Any help with this would be greatly appreciated. Dave 

Display selected items total in gridview footer


Hi all,

           I will have a gridview with checkboxes and some amount fields. I would like to display the sum of the amount in gridview footer depending on the checked items by the user. Can any one give me a sample code

C# data bound combobox: display selected item text in separate label.content


I am new to C# but I'm resisting the urge to run screaming back to VB.NET. I'm working with a WPF application using C# code-behind and a lot of binding to a SQL 2005 database backend.

GOAL: I have a comboBox bound to a tbl_Systems entity which provides a list of systems for user selection. When the User selects a system from the comboBox I want to display the selection's text in a separate Label. The big picture is that several comboBox selections will be used to build a query string that will populate a listbox. So, I want to display these selected values in the Label so the user can see the query string they have dictated.

PROBLEM: When I set the Label content property to the comboBox SelectedItem property the entity tbl_System is displayed in the Label not the comboBox selection text.

SUSPICION: From reading similar examples in VB I suspect that the comboBox SelectedItem is actually a "datarowview" or the C# equivalent. But I don't know how to translate this explanation to C#.

The UI XAML comboBox properties are set as such:


display the selected value in dropdown frm DB


this is with ref & continuation of post http://forums.asp.net/t/1612073.aspx

in which day drop is dynamicalluy populated at run time based on the month selected

the values selected are stored in the database.

suppose the user selects NOV 22 of the current year

when the user want to rertive the same stored data i need NOV in month dropdown & 22 in day dropdown

i get the month correctly but day dropdown is balnk


Dynamically display images from SQL database


I've found several good examples of how to display an image from a database, but I'm looking for an example of how to display an image within an aspx page with other controls.  This code works fine, but only displays the image by itself on the page (item4 is the image data, stored in SQL Server as type=Image):

Stream strmImage = new MemoryStream(item4.Image_Data.ToArray());
byte[] buffer = new byte[4096];
int byteSeq = strmImage.Read(buffer, 0, 4096);
while (byteSeq > 0)
    Response.OutputStream.Write(buffer, 0, byteSeq);
    byteSeq = strmImage.Read(buffer, 0, 4096);

I've also tried to save the data as a System.Drawing.Image, but like using the Response.Outputstream instruction above, it immediately outputs the image and nothing else on the page.

System.Drawing.Image myImage = System.Drawing.Image.FromStream(strmImage);
myImage.Save(Context.Response.OutputStream, ImageFormat.Jpeg);

In simple terms, I want to get the image from the database, stick it in a variable or something like that, then display it in a table.  Any suggestions?



How can we display images like we seen in amazon


How can we display images like this below the product

When i hover on the image the images needs to be changed, when i click on image and the image needs to be changed


ComboBox : Display selected value with Binding



I have a problem with my ComboBox, it won't show the selected value even if it select it. Items are binded.

Code behind: Me.DataContext = from Miss in myXDoc.<Miss>

Code XAML :





howto: display only hierarchy-members (levels) which are selected in the parameter (SSAS and SSRS)


Hi all,

I'm a SSRS/MDX beginner, so this might be a basic question. Sorry for that.

I have a hierarchy, which I use as a parameter. The Hierarchy has 3 levels (level1, level2, level3).

Sample Hierarchy

Now I want to achieve the following:

  • If a user selects CH1 --> the report should show only the CH1 (which is the sum of CH11 + CH12 + CH13)
  • If a user selects CH11 and CH12 and CH13 --> the report should show only these leafs (no aggregations)
  • If a user selects CH1 and CH11 and CH12 and CH13 --> the report should show the leafs and CH1 (seperate)

I guess, this is not that hard, but somehow I don't get it.

Here my sample mdx-query (the hierarchy I'm writing about is "Lieferantenstruktur" and the parameter "@Lieferant" (BOLD)):
(right now, only the leaf-level [Lieferant] is returend by the query)

SELECT NON EMPTY { [Measures].[Einheiten] } 

, NON EMPTY { ([Lieferantenstruktur].[Lieferantenstruktur].[Lieferant].ALLMEMBERS 
* [Artikel].[Artikel Kategorie].[Artikel Kategorie].ALLMEMBERS 
* [Artikel].[Artikel Gruppe Code Name].[Artikel Gruppe Code Name].ALLMEMBERS 
* {[Kundengruppen].[Kundengruppen].[Verkaufskanal].ALLMEMBERS 

How to display images horizontally


Hi guys,

I am trying to display two images next to one another (horizontally), but I am having no luck. They are being display underneath one another. There can be a maximum of 20 images that need to be displayed and I would like to display two per row. Does anyone know how to do this?

Thanks in advance.


display images randomly from mysql database


Hello to everybody,Smile

I'm a beginner in aspnet programming and I thought to become a member of this forum to learn better how to

program in this language (I use c# as code-behind language and visual studio 2008 environment).

I have a problem to solve: I want to display, on an aspnet page load, 12 random images taken from a mysql


I used connector-net in order to make mysql recognized by visual studio, I established a connection with the

database and I could display the content of 12 random rows of the table (eg ImageName, see below).

The database contains these columns:

ImageCode, ImageName, MaskName, ImageType

For example for the first row I have:

1 (ImageCode)

'C:\Inetpub\wwwroot\kf2\images\fuoco_bmp\fire10_res_res.bmp' (ImageName)


0 (ImageType)

I post you the code of the pageload I have written:

protected void Page_Load(object sender, EventArgs e)

MySql.Data.MySqlClient.MySqlConnection conn;

string myConnectionString =

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend