Tips Station Asp.net Article Seo Articles
Tutorials Code Samples
›  Home
›  Mission
›  About us
›  Contact Us
›  Feedback
›  Terms & Condition
Asp Articles
IT Solutions
 
› ASP.NET

› Programming Tips

› Ajax

› Asp

› ADO.NET

› Databases

› SEO

› CSS And Designing

› Php

 
Most Viewed Articles
 
› Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

› Change theme dynamically without page refresh in ASP.NET

› Install AJAX On Machines Running Visual Studio 2005

› Creating Pretty Popups Using AJAX

› Simple ASP Image Resize Function

› SQL Server Performance Counters

› ASP.Net Interview Questions And Their Answers

› Encode Url using ASP

› Difference Between DataGrid and GridView in Asp.Net

› Select Specific Value WithIn Drop Down List Or Radio Button List

more...
 
 
Home> Programming Tips
 
List of all selected items in a CheckBoxList - Asp.net
 

Get a list of each item that was checked in a CheckBoxList
An example page with a CheckBoxList:

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default1.aspx.vb" Inherits="Default1" %>  
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
      
    <html xmlns="http://www.w3.org/1999/xhtml" >  
    <head runat="server">  
        <title>Untitled Page</title>  
    </head>  
    <body>  
       <form id="form1" runat="server">  
       <div>  
           <asp:CheckBoxList ID="CheckBoxList1" runat="server">  
           <asp:ListItem Text="1" Value="1"></asp:ListItem>  
           <asp:ListItem Text="2" Value="2"></asp:ListItem>  
           <asp:ListItem Text="3" Value="3"></asp:ListItem>  
           </asp:CheckBoxList>  
           <asp:Button ID="Button1" runat="server" Text="Button" />  
       </div>  
       </form>  
   </body>  
   </html> 

 

How to retrieve each selected value:

   Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click  
       For Each li As ListItem In CheckBoxList1.Items  
           If li.Selected = True Then Response.Write(li.Value & "<br>")  
       Next  
   End Sub 

 
 
Vrp Technologies
 
Serversea Hosting
 
 
Latest Articles
 
› Sending SMS With PHP

› MySQL Join Tutorial

› Make An RSS Feed Using PHP

› Intro To Object: Option Variables

› Design An Online Chat Room With PHP And MySQL

› Create Tell A Friend Script With HTML & PHP

› Benchmark And Optimize PHP Script Speed

› What Kind of DBA Are You?

› SQL Server Performance Counters

› SQL Server Performance Tips

more...
 
Random Articles
 
› What SEO Tricks Must I Avoid When Optimizing My Pages?

› Creating Pretty Popups Using AJAX

› Clear all Cached objects in Asp.Net

› CSS Cursors - How To Use Them

› What Kind of DBA Are You?

› Application Object in Asp

› Your New Website Is Inside

› Intro To Object: Option Variables

› UpdatePanel control in Asp.net Ajax

› Ten Tips To Optimize Your Website

more...
 
Home Mission About us Contact us Feedback Terms Conditions
2008 © Copyright TipsStation. All rights reserved.