| | |
Checkbox list
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2009
Posts: 439
Reputation:
Solved Threads: 82
0
#2 25 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; 25 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 activexcontrol advice ajax appliances asp asp.net bc30451 beginner bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn cac checkbox child class click compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownmenu dynamic edit embeddingactivexcontrol feedback findcontrol flash flv form forms gridview homeedition hosting iframe iis javascript jquery list menu mono mssql multistepregistration nameisnotdeclared novell objects order problem ratings relationaldatabases rotatepage save search security serializesmo.table sessionvariables silverlight smartcard sql ssl suse textbox tracking treeview typeof unauthorized validatedate validation vb.net video virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment wizard xml





