| | |
Checkbox list
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2009
Posts: 433
Reputation:
Solved Threads: 82
0
#2 19 Days Ago
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; 19 Days Ago 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 |
.net 2.0 3.5 ajax alltypeofvideos appliances asp asp.net beginner box browser businesslogiclayer button c# c#gridviewcolumn cac checkbox class compatible confirmationcodegeneration content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv forms gridview gudi homeedition iis javascript jquery list listbox menu microsoft mouse mssql nameisnotdeclared news novell numerical opera order problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security serializesmo.table sessionvariables silverlight smoobjects software sql sql-server ssl tracking treeview validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming wizard xml xsl





