CheckBoxList Server side Values

T

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:
<asp:CheckBoxList ID="cboxDoBusiness" runat="server" RepeatColumns="10"
RepeatDirection="Horizontal" CellPadding="0" CellSpacing="0" Font-Size="7pt">
<asp:ListItem>AL</asp:ListItem>
<asp:ListItem>AK</asp:ListItem><asp:ListItem>AZ</asp:ListItem><asp:ListItem>AR</asp:ListItem>
<asp:ListItem>CA</asp:ListItem><asp:ListItem>CO</asp:ListItem><asp:ListItem>CT</asp:ListItem>
<asp:ListItem>DE</asp:ListItem><asp:ListItem>FL</asp:ListItem><asp:ListItem>GA</asp:ListItem>
<asp:ListItem>HI</asp:ListItem><asp:ListItem>ID</asp:ListItem><asp:ListItem>IL</asp:ListItem>……(all 50 states)
</asp:CheckBoxList>

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("ContactEmailTo2")
Dim lsSubject As String = "Contact Submitted at " +
System.DateTime.Now
Dim lsBody As String


lsBody = "Company Name: " + txtCompanyName.Text + "<br/>" + _
"Contact: " + txtContact.Text + "<br/>" + _
"Title: " + txtTitle.Text + "<br/>" + _
"Address: " + txtAddress.Text + "<br/>" + _
"City: " + txtCity.Text + "<br/>" + _
"How many years has your company been in business? " + selCompanyYears.Value
+ "<br/>" + _
"Please check the box next to all the states you are currently licensed to
do business in: " + cboxWorkRegular.Value + "<br/>" + _
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top