Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > HELP! DataFieldValue not retuning in asp:checkboxlist, what's wrong?

Reply
Thread Tools

HELP! DataFieldValue not retuning in asp:checkboxlist, what's wrong?

 
 
jeremy
Guest
Posts: n/a
 
      05-10-2004
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><aspropDownList id=ddStatus runat="server" DataValueField="status_id" DataTextField="status" DataSource="<%# dsStatus1 %>"></aspropDownList></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+O2w8dDw7bDx pPDE+O2k8Mz47PjtsPHQ8dDw7dDxpPDM+O0A8U2FsYXJ5IEVtc GxveWVlO0hvdXJseSBFbXBsb3llZTtDb250cmFjdG9yOz47QDw xOzI7Mzs+Pjs+Ozs+O3Q8dDw7dDxpPDM+O0A8U2FsYXJ5IEVtc GxveWVlO0hvdXJseSBFbXBsb3llZTtDb250cmFjdG9yOz47QDw xOzI7Mzs+Pjs+Ozs+Oz4+Oz4+O2w8c3RhdHVzTGlzdDowOz4+e K1UdZPqtVdA6sziuWE6nVeBFfs=" /><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>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why not 'foo = not f' instead of 'foo = (not f or 1) and 0'? Kristian Domke Python 11 01-23-2008 07:27 PM
'' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long. rote ASP .Net 2 01-23-2008 03:07 PM
Help, DropDown Web Control not Retuning "SelectedValue" Paul D. Fox ASP .Net Web Controls 2 06-01-2005 09:10 PM
Cisco 3640 3620 3600 not detecting, not enabling, not working: NM-2FE2W Taki Soho Cisco 0 09-22-2004 07:28 AM
maintaining control with cookies (not strictly an ASP or even server side question. But not not either) Stephanie Stowe ASP General 2 04-07-2004 04:23 PM



Advertisments