473,394 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Displaying Checkbox results

Hi, I am creating a web feedback form that has a both a checkbox and
listbox on it that are both databound to a database. I have been
researching all day and have found multiple answers for displaying the
results, but none of them work with databound checkbox lists. My
current code is:
Sub Check_Clicked(sender as Object, e As EventArgs)
lblPropTypes.Text = "Selected Item(s):<br><br>"
Dim i As Integer
For i=0 To cblPropTypes.Items.Count - 1
If cblPropTypes.Items(i).Selected Then
lblPropTypes.Text += cblPropTypes.Items(i).Text & ", "
End If
Next
End Sub

<asp:CheckBoxList id="cblPropTypes" runat="server"
datavaluefield="Class" datatextfield="Class"
OnSelectedIndexChanged="Check_Clicked"></asp:CheckBoxList>

Thanks in advance for any help!!
-Cabellm

Nov 21 '05 #1
2 1328
Actually I got part of this problem solved. I changed the databind
function to make sure it was only when the page was not post back. I
still cannot get my listbox to work though so any help would be great.
-Cabell

Nov 21 '05 #2
Cabelm,

Be aware that you have with a webpage to restore the datasource. By instance
like this in the load part of your page

\\\
if Not IsPostBack then
Get your dataset as ds
Session.Item("ds")=ds
else
ds = DirectCast(Session.Item("ds"),Dataset)
End if
///

And don't forget to databind as last action before the sent back to the
client.

I hope this helps,

Cor
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Shufen | last post by:
Hi, I'm a newbie that just started to learn python, html and etc. I have some questions to ask and hope that someone can help me on. I'm trying to code a python script (with HTML) to get...
3
by: Harold A. Mackey | last post by:
I'm having a time finding some examples of checkbox results in a database. I first tried setting up the fields as bit in the stored procedures. I have not been able to determine the output of a...
5
by: Greg Hurlman | last post by:
I've got a very simple ASCX page, where once someone finishes a section and clicks the "Next >" button, the section they just finished is disabled, and the next section appears below it, and so on....
2
by: ward | last post by:
Hello. I have a table with two fields: 1) groups_id 2) groups_name The data contained is simple: groups_id groups_name ----------- ----------------
1
by: vasbjornsen | last post by:
I'm trying to build a program that will display checkbox text in a label after clicking a Submit button. I'm a student in the beginning stages being instructed on Visual Studio 2005, so please go...
1
by: mmcnab | last post by:
I've read several of the site articles and posts on this subject but am still confused. I have a form that contains radio buttons, checkboxes and a text form. The problem is the checkboxes. I process...
0
by: TechnoAtif | last post by:
<?php include "dbconnect.php"; include "commonFunc.php"; ?> <!----------------------------------> <table width="80%" border="1" cellpadding="2" cellspacing="0"> <tr > <td...
6
by: jasone | last post by:
Hi all! im developing a system where a user can select what flower goes into their bouquet, and ive become a little bit stuck... heres what ive done to date: currently ive got a page displaying...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.