| | |
Checkbox list
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2009
Posts: 449
Reputation:
Solved Threads: 82
0
#2 Nov 10th, 2009
Do you mean ASP.NET Panel control or UpdatePanel?
If ASP.NET Panel, it is rendered as DIV at run time. Apart from that there won't be any issues when displaying a CheckBoxList inside a Panel or without Panel.
Check this code.
.aspx code
C# Code
If ASP.NET Panel, it is rendered as DIV at run time. Apart from that there won't be any issues when displaying a CheckBoxList inside a Panel or without Panel.
Check this code.
.aspx code
ASP.NET Syntax (Toggle Plain Text)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DemoPage38.aspx.cs" Inherits="DemoPage38" %> <!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></title> </head> <body> <form id="form1" runat="server"> <div> <table width="100%"> <tr> <td> <asp:Panel ID="Panel1" runat="server"> <asp:CheckBoxList ID="cblBooks" runat="server"> </asp:CheckBoxList> </asp:Panel> </td> </tr> </table> </div> </form> </body> </html>
C# Code
ASP.NET Syntax (Toggle Plain Text)
using System; using System.Data; public partial class DemoPage38 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindCheckBoxList(); } } private void BindCheckBoxList() { //You can load the following DataTable from a database DataTable dtBooks = new DataTable(); dtBooks.Columns.Add("Book_Id", System.Type.GetType("System.Int32")); dtBooks.Columns.Add("Book_Name", System.Type.GetType("System.String")); dtBooks.Rows.Add(new object[] { 100, "ASP.NET Programming" }); dtBooks.Rows.Add(new object[] { 101, "Beginning Web Development" }); dtBooks.Rows.Add(new object[] { 102, "ASP.NET for Dummies" }); dtBooks.Rows.Add(new object[] { 103, "SharePoint 2007" }); dtBooks.Rows.Add(new object[] { 104, "PHP Programming" }); //Binding DataTable to the CheckBoxList control cblBooks.DataSource = dtBooks; cblBooks.DataTextField = "Book_Name"; cblBooks.DataValueField = "Book_Id"; cblBooks.DataBind(); } }
Last edited by Ramesh S; Nov 10th, 2009 at 8:32 am.
![]() |
Similar Threads
- Check or uncheck items in a checkbox list, based on information from database (ASP.NET)
- Input Validation...CheckBox and List (VB.NET)
- How to insert checkbox data into mysql? (PHP)
- Custom Controls (Checkbox / List) (VB.NET)
- insert checkbox list (VB.NET)
- checkbox validation.. (Visual Basic 4 / 5 / 6)
- how to loop thru checked checkbox to retrieve its value?!? (ASP.NET)
- Internet Explorer Running SLOW (Web Browsers)
- new and in need (ASP)
Other Threads in the ASP.NET Forum
- Previous Thread: Export Lable text into Excel
- Next Thread: Transfer data between pages
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 activexcontrol ajax alltypeofvideos anathor appliances application asp asp.net bc30451 beginner box browser button c# cac checkbox commonfunctions complex dataaccesslayer database datagridview datagridviewcheckbox datalist development dgv dialog dropdownlist dynamically edit editing expose feedback fileuploader fill flash form formatdecimal formview google gridview gudi iis image javascript list listbox login microsoft migration mouse mssql news numerical opera panelmasterpagebuttoncontrols parent problem project radio redirect registration relationaldatabases reportemail response.redirect richtextbox rows save schoolproject search security select session sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking treeview unauthorized validatedate validation vb.net video videos vista visualstudio web webapplications webdevelopemnt webprogramming webservice xsl youareanotmemberofthedebuggerusers





