CheckBoxList Server side Values

CheckBoxList Server side Values

am 23.01.2008 03:13:04 von Todd

Hello,
I'm a novice, but here is my problem:
I've got a simple web form that sends an email with the data from the fields
on the form to an email address. It is simple in the fact that it is about
15 questions. I do have four CheckBoxList that I am using. Two of them have
50 checkboxes per. (the 50 state abbreviations) I need this to understand
what states the user is licensed in.
One of the checkboxlists on my asp page:
RepeatDirection="Horizontal" CellPadding="0" CellSpacing="0" Font-Size="7pt">
AL
AKAZAR
CACOCT
DEFLGA
HIIDIL……(all 50 states)


My asp.vb page that sends the email:
Protected Sub SendEmail()

Try
'(1) Define the MailMessage fields
Dim lsFrom As String = txtEmail.Text
Dim lsTo As String =
System.Configuration.ConfigurationManager.AppSettings("Conta ctEmailTo2")
Dim lsSubject As String = "Contact Submitted at " +
System.DateTime.Now
Dim lsBody As String


lsBody = "Company Name: " + txtCompanyName.Text + "
" + _
"Contact: " + txtContact.Text + "
" + _
"Title: " + txtTitle.Text + "
" + _
"Address: " + txtAddress.Text + "
" + _
"City: " + txtCity.Text + "
" + _
"How many years has your company been in business? " + selCompanyYears.Value
+ "
" + _
"Please check the box next to all the states you are currently licensed to
do business in: " + cboxWorkRegular.Value + "
" + _
Obviously cboxWorkRegular.Value doesn’t return a value. How can I capture
the “selected” from my checkboxlist so I can show in the body of the email
that is created?

Thanks
Todd