J
jeremy
I'm having trouble getting the value to post to my checkbox list once the server has returend the page.
I have two examples, one using the checkbox list and another using a dropdownlist. The dropdownlist returns the value with no problems but the checkbox list doesn't. WHY? is there something i'm missing
Both use the same DataSets and attributes
Here is my code, code behind, and rendered code
** Code *
<%@ Page language="c#" Codebehind="default.aspx.cs" AutoEventWireup="false" Inherits="osi_resume_tracker.WebForm1" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML><HEAD><title>WebForm1</title><meta content="Microsoft Visual Studio 7.0" name="GENERATOR"><meta content="C#" name="CODE_LANGUAGE"><meta content="JavaScript" name="vs_defaultClientScript"><meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"></HEAD><body><form id="Form1" method="post" runat="server"><asp:CheckBoxList id=statusList runat="server" DataSource="<%# dsStatus1 %>" DataTextField="status" DataValueField="status_id" RepeatLayout="Table" DataMember="tbl_status"></asp:CheckBoxList><BR><BR><asp
ropDownList id=ddStatus runat="server" DataValueField="status_id" DataTextField="status" DataSource="<%# dsStatus1 %>"></asp
ropDownList></form></body></HTML
********************************************
** code behind *
using System
using System.Collections
using System.ComponentModel
using System.Data
using System.Drawing
using System.Web
using System.Web.SessionState
using System.Web.UI
using System.Web.UI.WebControls
using System.Web.UI.HtmlControls
namespace osi_resume_tracke
/// <summary
/// Summary description for WebForm1
/// </summary
public class WebForm1 : System.Web.UI.Pag
protected System.Data.OleDb.OleDbCommand scStatus
protected System.Data.OleDb.OleDbConnection oleDbConn
protected System.Data.OleDb.OleDbCommand scJobTitle
protected System.Data.OleDb.OleDbDataAdapter daJobTitle
protected osi_resume_tracker.dsStatus dsStatus1
protected osi_resume_tracker.dsJobTitle dsJobTitle1
protected System.Web.UI.WebControls.CheckBoxList statusList
protected System.Web.UI.WebControls.DropDownList ddStatus
protected System.Data.OleDb.OleDbDataAdapter daStatus
private void Page_Load(object sender, System.EventArgs e
// Put user code to initialize the page her
daStatus.Fill(dsStatus1)
//statusList.DataSource = dsStatus1
statusList.DataBind()
ddStatus.DataBind()
#web form regio
******************************************
** rendered code *
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML><HEAD><title>WebForm1</title><meta content="Microsoft Visual Studio 7.0" name="GENERATOR"><meta content="C#" name="CODE_LANGUAGE"><meta content="JavaScript" name="vs_defaultClientScript"><meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"></HEAD><body><form name="Form1" method="post" action="default.aspx" id="Form1"><input type="hidden" name="__VIEWSTATE" value="dDwxMDMyOTQ0MjM0O3Q8O2w8aTwxPjs+O2w8dDw7bDxpPDE+O2k8Mz47PjtsPHQ8dDw7dDxpPDM+O0A8U2FsYXJ5IEVtcGxveWVlO0hvdXJseSBFbXBsb3llZTtDb250cmFjdG9yOz47QDwxOzI7Mzs+Pjs+Ozs+O3Q8dDw7dDxpPDM+O0A8U2FsYXJ5IEVtcGxveWVlO0hvdXJseSBFbXBsb3llZTtDb250cmFjdG9yOz47QDwxOzI7Mzs+Pjs+Ozs+Oz4+Oz4+O2w8c3RhdHVzTGlzdDowOz4+eK1UdZPqtVdA6sziuWE6nVeBFfs=" /><table id="statusList" border="0"><tr><td><input id="statusList_0" type="checkbox" name="statusList:0" /><label for="statusList_0">Salary Employee</label></td></tr><tr><td><input id="statusList_1" type="checkbox" name="statusList:1" /><label for="statusList_1">Hourly Employee</label></td></tr><tr><td><input id="statusList_2" type="checkbox" name="statusList:2" /><label for="statusList_2">Contractor</label></td></tr></table><BR><BR><select name="ddStatus" id="ddStatus"><option value="1">Salary Employee</option><option value="2">Hourly Employee</option><option value="3">Contractor</option></select></form></body></HTML>
I have two examples, one using the checkbox list and another using a dropdownlist. The dropdownlist returns the value with no problems but the checkbox list doesn't. WHY? is there something i'm missing
Both use the same DataSets and attributes
Here is my code, code behind, and rendered code
** Code *
<%@ Page language="c#" Codebehind="default.aspx.cs" AutoEventWireup="false" Inherits="osi_resume_tracker.WebForm1" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML><HEAD><title>WebForm1</title><meta content="Microsoft Visual Studio 7.0" name="GENERATOR"><meta content="C#" name="CODE_LANGUAGE"><meta content="JavaScript" name="vs_defaultClientScript"><meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"></HEAD><body><form id="Form1" method="post" runat="server"><asp:CheckBoxList id=statusList runat="server" DataSource="<%# dsStatus1 %>" DataTextField="status" DataValueField="status_id" RepeatLayout="Table" DataMember="tbl_status"></asp:CheckBoxList><BR><BR><asp
********************************************
** code behind *
using System
using System.Collections
using System.ComponentModel
using System.Data
using System.Drawing
using System.Web
using System.Web.SessionState
using System.Web.UI
using System.Web.UI.WebControls
using System.Web.UI.HtmlControls
namespace osi_resume_tracke
/// <summary
/// Summary description for WebForm1
/// </summary
public class WebForm1 : System.Web.UI.Pag
protected System.Data.OleDb.OleDbCommand scStatus
protected System.Data.OleDb.OleDbConnection oleDbConn
protected System.Data.OleDb.OleDbCommand scJobTitle
protected System.Data.OleDb.OleDbDataAdapter daJobTitle
protected osi_resume_tracker.dsStatus dsStatus1
protected osi_resume_tracker.dsJobTitle dsJobTitle1
protected System.Web.UI.WebControls.CheckBoxList statusList
protected System.Web.UI.WebControls.DropDownList ddStatus
protected System.Data.OleDb.OleDbDataAdapter daStatus
private void Page_Load(object sender, System.EventArgs e
// Put user code to initialize the page her
daStatus.Fill(dsStatus1)
//statusList.DataSource = dsStatus1
statusList.DataBind()
ddStatus.DataBind()
#web form regio
******************************************
** rendered code *
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML><HEAD><title>WebForm1</title><meta content="Microsoft Visual Studio 7.0" name="GENERATOR"><meta content="C#" name="CODE_LANGUAGE"><meta content="JavaScript" name="vs_defaultClientScript"><meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"></HEAD><body><form name="Form1" method="post" action="default.aspx" id="Form1"><input type="hidden" name="__VIEWSTATE" value="dDwxMDMyOTQ0MjM0O3Q8O2w8aTwxPjs+O2w8dDw7bDxpPDE+O2k8Mz47PjtsPHQ8dDw7dDxpPDM+O0A8U2FsYXJ5IEVtcGxveWVlO0hvdXJseSBFbXBsb3llZTtDb250cmFjdG9yOz47QDwxOzI7Mzs+Pjs+Ozs+O3Q8dDw7dDxpPDM+O0A8U2FsYXJ5IEVtcGxveWVlO0hvdXJseSBFbXBsb3llZTtDb250cmFjdG9yOz47QDwxOzI7Mzs+Pjs+Ozs+Oz4+Oz4+O2w8c3RhdHVzTGlzdDowOz4+eK1UdZPqtVdA6sziuWE6nVeBFfs=" /><table id="statusList" border="0"><tr><td><input id="statusList_0" type="checkbox" name="statusList:0" /><label for="statusList_0">Salary Employee</label></td></tr><tr><td><input id="statusList_1" type="checkbox" name="statusList:1" /><label for="statusList_1">Hourly Employee</label></td></tr><tr><td><input id="statusList_2" type="checkbox" name="statusList:2" /><label for="statusList_2">Contractor</label></td></tr></table><BR><BR><select name="ddStatus" id="ddStatus"><option value="1">Salary Employee</option><option value="2">Hourly Employee</option><option value="3">Contractor</option></select></form></body></HTML>