Can't get data from form into HTML email - 'Value' is not a member...

M

Marie

Hello

When I try to run my asp.net page I get this error message

<<
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30456: 'Value' is not a member of 'System.Web.UI.WebControls.CheckBox'

Source Error


Line 39: Dim HtmlMsgBody = "<HTML><HEAD></HEAD>
Line 40: HtmlMsgBody = HtmlMsgBody + "<FORM><P>" + "<input name='' type='checkbox' disabled='true' "
Line 41: if (kemregler_14_april.Value = "ikryssad")
Line 42: + "Checked />"
Line 43: else


Source File: d:\users\marie\Anmalan_test.aspx Line: 41

What I'm trying to do is to display the customer's choice
of the form (in a HTML email as a verification to the customer),
which is done by another form with disabled fields just collecting
the data from the original form. Is this possible

This is how the code looks:

The form

<<<<html><head><title>xxx</title></head><body><p>Jag vill <strong>anm&auml;la mig</strong> till f&ouml;ljande kurs/kurser:
</p><form runat="server"><p><asp:checkbox ID="kemregler_14_april" Value="ikryssad" runat="server" /
Kemikalieregler Stockholm 14 april N&auml;ringslivets Hus, Storgatan 19 <br></p><table width="95%" border="0"><tr><td width="200" valign="top" class="brod"><p>E-post:</p></td><td><asp:textbox ID="epost" MaxLength="60" runat="server" TextMode="SingleLine" /></td></tr></table><p><asp:button ID="submit_button" runat="server" Text="Skicka" OnClick="SubmitBtn_Click"
</p></form></body></html>>>

The server script (VB)

<<<<%@ Page Language="VB" ContentType="text/html" %><%@ Import Namespace="System.Web.Mail" %><script runat="server"

Sub SubmitBtn_Click(Src As Object, E As EventArgs
'Skickar mai
Dim emailMsg As New MailMessag
emailMsg.To = "(e-mail address removed)
'emailMsg.To = "(e-mail address removed)
emailMsg.Cc = epost.Text 'Bekräftan till användaren
emailMsg.From = epost.Tex
emailMsg.Subject = "Anmälan

Dim HtmlMsgBody = "<HTML><HEAD></HEAD>
HtmlMsgBody = HtmlMsgBody + "<FORM><P>" + "<input name='' type='checkbox' disabled='true' "
if (kemregler_14_april.Value = "ikryssad")
+ "Checked />"
else
+ "/>
HtmlMsgBody = HtmlMsBody + "Kemikalieregler Stockholm 14 april N&auml;ringslivets Hus, Storgatan 19 <br>
HtmlMsgBody = HtmlMsBody + "</P></FORM>

emailMsg.Body = HTMLMsgBod
emailMsg.BodyFormat = MailFormat.Htm
tr
SmtpMail.Send(emailMsg
Response.Write("Tack för din anmälan. Vi skickar dig en bekräftelse med e-post."

catch exc as Exceptio
Response.Write("NÃ¥got gick fel: " + exc.ToString()
End Tr
End Su

</script>>>

Thank you for helping me with this problem! :-
Mari

PS. Please also send me your answer to my email address sinc
I'm in a hurry to complete this task because of the
deadline for this project is already passed.
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top