PC Review


Reply
Thread Tools Rate Thread

CheckBoxList Server side Values

 
 
Todd
Guest
Posts: n/a
 
      23rd Jan 2008
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
checkboxlist & client side script sdoerfli@edu.uni-klu.ac.at Microsoft ASP .NET 0 28th Mar 2007 11:43 AM
client-side code checkboxlist =?Utf-8?B?U2FuZHk=?= Microsoft ASP .NET 2 14th Jun 2005 01:58 PM
CheckBoxList Clear - client side? Tina Microsoft ASP .NET 1 23rd Apr 2005 07:20 AM
Unable to access values at server side. aarsalan@gamil.com Microsoft Dot NET Framework 1 18th Nov 2004 05:30 AM
Client Side Values passed from Server John Cosmas Microsoft Dot NET Framework 4 2nd Oct 2004 08:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:12 PM.