Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Help For Newbie Please

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bgreer5050@yahoo.com - 28 Aug 2007 17:18 GMT
I know I am missing something simple.  Can someone help me identify
it?  I am getting the following error:

*****************Error*********************************************

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: 'btnSubmit_Click' is not a member of
'ASP.emailforms_aspx'.

Source Error:

Line 67: <p align="center">
Line 68:
Line 69: <asp:Button Runat = server ID = btnSubmit OnClick =
btnSubmit_Click Text = "Submit"></asp:Button>
Line 70: &nbsp;<input id="Reset1" type = "reset" runat = "server"
value = "Clear"></td>
Line 71: </tr>

****************The Entire Page**********************************

<!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 id="Head1" runat="server">
   <title>Untitled Page</title>
</head>
<body>
   <form id="form1" runat="server">
   <div align="left">
   <table> border="0" width="544"
   <tr>
   <td valign="top"><font face="Verdana" size="2">Name</font></td>
   <td height="24" valign="top"> <asp:TextBox runat="server"
Height="25px" Width="370px" ID="txtName"></asp:TextBox>
   <asp:RequiredFieldValidator ID="reqName"
ControlToValidate="txtName" runat="Server" ErrorMessage="*"></
asp:RequiredFieldValidator></td>
   </tr>
   <tr>
   <td valign="top"><font size="2" face="Verdana">Address</font></td>
   <td height="24" valign="top">
   <asp:TextBox runat="Server" Height="25px" Width="370px"
ID="txtAddress"></asp:TextBox></td>
   </tr>
   <tr>
   <td valign="top"><font face="Verdana" size="2">From</font></td>
   <td height="24" valign="top"> <asp:TextBox runat="server"
Height="22px" Width="368px"
   ID="txtFrom"></asp:TextBox>
   <asp:RequiredFieldValidator ID = "reqFrom1" ControlToValidate =
"txtFrom" runat = "server" ErrorMessage =
   "*" ></asp:RequiredFieldValidator>
   <asp:RegularExpressionValidator ID = "regFrom2" ControlToValidate
= "txtFrom" runat = "server"
   ErrorMessage = "Invalid Email" ValidationExpression="\w+([-+.]\w
+)*@\w+([-.]\w+)*\.\w+([-.]
   \w+)*"></asp:RegularExpressionValidator>
   <br></td>

</tr>

<tr>

<td valign="top"><font face="Verdana" size="2">To</font></td>

<td height="24" valign="top">

<asp:TextBox runat="server" Height="22px" Width="368px" ID="txtTo"></
asp:TextBox>

<asp:RequiredFieldValidator ID = "reqTo1" ControlToValidate = "txtTo"
runat = "server" ErrorMessage = "*" ></asp:RequiredFieldValidator>

<asp:RegularExpressionValidator ID = "reqTo2" ControlToValidate =
"txtTo" runat = "server" ErrorMessage = "Invalid Email"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></
asp:RegularExpressionValidator>

</td>

</tr>

<tr>

<td valign="top"><font face="Verdana" size="2">Comments</font></td>

<td height="112" valign="top"><asp:TextBox runat="server"
Height="110px" TextMode="MultiLine" Width="368px" ID="txtComments"></
asp:TextBox>

<asp:RequiredFieldValidator ID = "reqComments" ControlToValidate =
"txtComments" Runat = "server" ErrorMessage = "*"></
asp:RequiredFieldValidator> </td>

</tr>

<tr>

<td colspan="2" valign="top" height="30">

<p align="center">

<asp:Button Runat = server ID = btnSubmit OnClick = btnSubmit_Click
Text = "Submit"></asp:Button>
&nbsp;<input id="Reset1" type = "reset" runat = "server" value =
"Clear"></td>
</tr>
</table>
</div>
<p>&nbsp;</p>
<p><br>

<!-- Insert content here -->
Content
</p>
</form>
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Net.Mail" %>

Dim smtpClient As New SmtpClient()
Dim objMail As New MailMessage()

Dim objMail_fromaddress As New MailAddress(txtFrom.Text)

Dim objMail_fromaddress As New MailAddress(txtFrom.Text, "Learnxpress
Support")

Dim objMail_toaddress As New MailAddress(txtTo.Text)
objMail.From = objMail_fromaddress
objMail.To.Add(objMail_toaddress)
objMail.Subject = "E-mail Example - Visual Basic - Text"
objMail.Body = "Name: " &txtName.Text &vbCrLf & _
"Address: " &txtAddress.Text &vbCrLf & _
"Comments: " &txtComments.Text

objMail.Priority = MailPriority.High

smtpClient.Host = "mail.domain.com"
smtpClient.Credentials = New
System.Net.NetworkCredential("username@domain.com","Password")

try

smtpClient.Send(objMail)

Response.Redirect("http://www.c-sharpcorner.com")

catch exc as Exception

Response.Write("Send failure: " + exc.ToString())

End Try
Steve - 28 Aug 2007 17:24 GMT
Your button is trying to call the btnSubmit_Click() event in your code,
but I don't see it in there? Maybe it got deleted?

Steve C.
MCSD,MCAD,MCSE,MCP+I,CNE,CNA,CCNA

> I know I am missing something simple.  Can someone help me identify
> it?  I am getting the following error:
[quoted text clipped - 154 lines]
>
> End Try
Mark Rae [MVP] - 28 Aug 2007 17:28 GMT
>I know I am missing something simple.  Can someone help me identify
> it?

You don't appear to have a btnSubmit_Click method in your server-side
code...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.