Home > Archive > Visual Basic Syntax > April 2005 > Emailing CheckBoxList results
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Emailing CheckBoxList results
|
|
| Gamlyn 2005-04-08, 4:02 pm |
| Can anyone please show me what the VB would look like to get CheckBoxList
form results into a oMessage.Body for sending in email?
This is an example of my CheckBoxList:
<asp:CheckBoxList ID="ckbThings" runat="server">
<asp:ListItem Value="Thing 1">Thing 1</asp:ListItem>
<asp:ListItem Value="Thing 2">Thing 2</asp:ListItem>
<asp:ListItem Value="Thing 3">Thing 3</asp:ListItem>
</asp:CheckBoxList>
I have the following code already (where ????????? is what I can't figure
out). I suspect I need another Dim, but does it all come together?:
<script language="vb" runat="server">
Sub btnSendEmail_OnClick(sender As Object, e As EventArgs)
Dim sBody1, sBody2
sBody1 = "My name is: " & txtName.Text
sBody2 = "I chose these things: " ?????????????
Dim oMessage As New MailMessage
oMessage.To = "joe@schmoe.com"
oMessage.From = "WebForm@company.com"
oMessage.Subject = "Things selected"
oMessage.Body = sBody1 & vbCrLf & sBody2
SmtpMail.Send(oMessage)
Response.Redirect("thankyou.aspx")
End Sub
</script>
Thank you!
| |
|
| Better off asking the ASP.NET newsgroup...
Standard Response:
Almost everybody in this newsgroup is using VB6 or lower. While you may get
a stray answer to VB.NET questions here, you should ask them in newsgroups
devoted exclusively to .NET programming. Look for newsgroups with either the
word "dotnet" or "vsnet" in their name.
For the microsoft news server, try these newsgroups...
microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb
microsoft.public.vsnet.general
--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/
"Gamlyn" <Gamlyn@discussions.microsoft.com> wrote in message
news:46AF9C13-D731-4FF5-AE37-0176C9BC1BD3@microsoft.com...
> Can anyone please show me what the VB would look like to get CheckBoxList
> form results into a oMessage.Body for sending in email?
>
> This is an example of my CheckBoxList:
> <asp:CheckBoxList ID="ckbThings" runat="server">
> <asp:ListItem Value="Thing 1">Thing 1</asp:ListItem>
> <asp:ListItem Value="Thing 2">Thing 2</asp:ListItem>
> <asp:ListItem Value="Thing 3">Thing 3</asp:ListItem>
> </asp:CheckBoxList>
>
> I have the following code already (where ????????? is what I can't figure
> out). I suspect I need another Dim, but does it all come together?:
>
> <script language="vb" runat="server">
> Sub btnSendEmail_OnClick(sender As Object, e As EventArgs)
>
> Dim sBody1, sBody2
> sBody1 = "My name is: " & txtName.Text
> sBody2 = "I chose these things: " ?????????????
>
> Dim oMessage As New MailMessage
> oMessage.To = "joe@schmoe.com"
> oMessage.From = "WebForm@company.com"
> oMessage.Subject = "Things selected"
> oMessage.Body = sBody1 & vbCrLf & sBody2
>
> SmtpMail.Send(oMessage)
> Response.Redirect("thankyou.aspx")
>
> End Sub
> </script>
>
> Thank you!
|
|
|
|
|