Ошибка "panelSendEmail" не объявлена. Он может быть недоступен из-за своего уровня защиты.
Почему эта ошибка дает 'panelSendEmail' не объявляется. Он может быть недоступен из-за своего уровня защиты
Мой код таков
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="feedback webmail.aspx.vb" Inherits="feedback_webmail" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <panel> <h2>We are interested in your feedback! Please enter the following requested information below to send us your comments.</h2></panel> Your Name: <asp:textbox id="txtName" runat="server" /> <br> Your Email Address: <asp:textbox id="txtEmail" runat="server" /> <p> Your Message:<br> <asp:textbox id="txtMessage" TextMode="MultiLine" Columns="40" Rows="10" runat="server" /> <p> <asp:button runat="server" id="btnSendFeedback" Text="Send Feedback!"/> </p></br></p></br></div> </form> </body> </html>
цвет coading часть
Inherits System.Web.UI.Page Protected Sub btnSendFeedback_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSendFeedback.Click 'Create an instance of the MailMessage class Dim objMM As New MailMessage() 'Set the properties - send the email to the person who filled out the 'feedback form. objMM.To = "contact@kamnatrust.com" objMM.From = txtEmail.Text 'If you want to CC this email to someone else, uncomment the line below 'objMM.Cc = "someone@someaddress.com" 'If you want to BCC this email to someone else, uncomment the line below 'objMM.Bcc = "someone@someaddress.com" 'Send the email in text format objMM.BodyFormat = MailFormat.Text '(to send HTML format, change MailFormat.Text to MailFormat.Html) 'Set the priority - options are High, Low, and Normal objMM.Priority = MailPriority.Normal 'Set the subject objMM.Subject = "Feedback" 'Set the body objMM.Body = "At " + DateTime.Now + " feedback was sent from an ASP.NET " & _ "Web page. Below you will find the feedback message " & _ "send by " & txtName.Text & "." & vbCrLf & vbCrLf & _ "---------------------------------------" & vbCrLf & vbCrLf & _ txtMessage.Text & vbCrLf 'Specify to use the default Smtp Server SmtpMail.SmtpServer = "webmail.kamnatrust.com" 'Now, to send the message, use the Send method of the SmtpMail class SmtpMail.Send(objMM) panelSendEmail.Visible = False panelMailSent.Visible = True End Sub End Class