[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

email feedback with radio button

Asked by 9apit in .NET, Programming for ASP.NET, .NET Framework 2.x

Good afternoon expert,
Putting together form that emails form input from ASP.net page.
The page works with textboxes. Trying to add radio buttons and multiple
textboxes.  It looks like Body is an object created by 'System.Net.Mail.MailMessage'
because when use the input ID for the radio button group I get
Compiler Error Message: BC30456: 'red' is not a member of 'System.Net.Mail.MailMessage'.
How can I send radio buttons and more than one 'Body" using the .net MailMessage class?
Thanks.
Allen in Dallas
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
+++++++++++++++++begin aspx page++++++++++++++++++++
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ListingInquiry_c.aspx.vb" Inherits="_Default" title="Liesting Inquiry" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
</head>
<body>
<table width="800" border="0" cellpadding="0" cellspacing="0">
      		<form id="form1" runat="server">
		    <table width="100%" border="0" cellpadding="5">
		        <tr>
		            <td valign="top" style="width:auto;">
		            	    <asp:Panel runat="server" ID="EmailForm">
				    <table border="0">
		        <tr>
			            <td><b>Your name:</b></td>
            <td><asp:TextBox runat="server" ID="Subject" Columns="30"></asp:TextBox>
                        <asp:RequiredFieldValidator
    	        ControlToValidate="Subject"
    	        Text="Please input your name."
	runat="server" />
            </td>
        </tr>
        <tr>
    <td><b>Your Email:</b></td>
	    <td align="left">
    <asp:TextBox ID="UsersEmail" CssClass="textbox" runat="server" Columns="30"></asp:TextBox>
    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UsersEmail" ErrorMessage="please enter e-mail." ToolTip="please enter email" Display="Dynamic" SetFocusOnError="True"></asp:RequiredFieldValidator>
					    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="UsersEmail" Display="Dynamic" ErrorMessage="e-mail is not valid " SetFocusOnError="True" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
	</td>
	</tr>
        <tr>
           <td colspan="2">
                <b>Body:</b><br />
  <asp:TextBox runat="server" ID="Body" TextMode="MultiLine" Columns="55" Rows="10"></asp:TextBox>
            </td>
  </tr>
        <tr>
      <td colspan="2">
      <asp:RadioButton id="red" Text="Red" Checked="True" 
        GroupName="colors" runat="server"/>
	<br />
	<asp:RadioButton id="green" Text="Green"
	GroupName="colors" runat="server"/>
                   <br />
	<asp:RadioButton id="blue" Text="Blue" 
	GroupName="colors" runat="server"/>
	<br />
	       </td>
      	 </tr>
	       <tr>
	           <td colspan="2" align="center">
	              <asp:Button runat="server" ID="SendEmail" Text="Send Feedback" />
	           </td>
	       </tr>
	    </table>
	   </asp:Panel>
	   <asp:Panel runat="server" ID="EmailSentForm">
	    Your feedback has been sent... thank you!
		    </asp:Panel>
		            </td>
		        </tr>
		    </table>
		    </form>
</td>
  </tr>
</table>
</body>
</html>
+++++++++++++++++end aspx page++++++++++++++++++++
+++++++++++++++++begin aspx.vb page++++++++++++++++++++
'Add the namespace for the email-related classes
Imports System.Net.Mail
Partial Class _Default
    Inherits System.Web.UI.Page
    Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SendEmail.Click
        '!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
        Const ToAddress As String = "apitts0217@yahoo.com"
 
        '(1) Create the MailMessage instance
        Dim mm As New MailMessage(UsersEmail.Text, ToAddress)
 
        '(2) Assign the MailMessage's properties
        mm.Subject = Subject.Text
        mm.Body = Body.Text
        mm.IsBodyHtml = False
        'mm.red = red.Text
 
        '(3) Create the SmtpClient object
        Dim smtp As New SmtpClient
 
        '(4) Send the MailMessage (will use the Web.config settings)
        smtp.Send(mm)
 
 
        'Show the EmailSentForm Panel and hide the EmailForm Panel
        EmailSentForm.Visible = True
        EmailForm.Visible = False
    End Sub
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            'On the first page load, hide the EmailSentForm Panel
            EmailSentForm.Visible = False
        End If
    End Sub
End Class
+++++++++++++++++++++++end aspx.vb code++++++++++++++++++++++
[+][-]10/30/09 04:13 AM, ID: 25701773Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: .NET, Programming for ASP.NET, .NET Framework 2.x
Sign Up Now!
Solution Provided By: strickdd
Participating Experts: 1
Solution Grade: A
 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625