Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > feedback form using ASP.NET and VB.NET

Reply
Thread Tools

feedback form using ASP.NET and VB.NET

 
 
Mario Krsnic
Guest
Posts: n/a
 
      05-29-2006
Hello!
I made a feedback form using ASP.NET and VB.NET. It works, but I receive
allways two mails from server instead of one. Why?
Thanks for every idea!
Mario
Here the code:

Imports System.web.Mail

Partial Class _Default

Inherits System.Web.UI.Page

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click

Dim objMail As New MailMessage()

objMail.From = txtFrom.Text

objMail.To = my_mail_address@my_domaine.tld

objMail.Subject = txtSubject.Text

objMail.Body = txtBody.Text

objMail.BodyFormat = MailFormat.Text

SmtpMail.SmtpServer = "smtp.my_server"

SmtpMail.Send(objMail)

litStatus.Text = "Sent!"

End Sub

End Class


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      05-29-2006
Sounds like you've managed to get your click event wired up twice. Try
setting AutoEventWireup="false" in the ASPX @Page declaration.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"Mario Krsnic" wrote:

> Hello!
> I made a feedback form using ASP.NET and VB.NET. It works, but I receive
> allways two mails from server instead of one. Why?
> Thanks for every idea!
> Mario
> Here the code:
>
> Imports System.web.Mail
>
> Partial Class _Default
>
> Inherits System.Web.UI.Page
>
> Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles btnSubmit.Click
>
> Dim objMail As New MailMessage()
>
> objMail.From = txtFrom.Text
>
> objMail.To = my_mail_address@my_domaine.tld
>
> objMail.Subject = txtSubject.Text
>
> objMail.Body = txtBody.Text
>
> objMail.BodyFormat = MailFormat.Text
>
> SmtpMail.SmtpServer = "smtp.my_server"
>
> SmtpMail.Send(objMail)
>
> litStatus.Text = "Sent!"
>
> End Sub
>
> End Class
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Feedback from feedback on MCP questions Matt Adamson Microsoft Certification 0 04-27-2009 11:13 AM
Feedback form using cgi script LaMoRt Perl Misc 5 08-14-2007 08:18 PM
Feedback form PROBLEM Zagor ASP .Net 6 09-14-2004 02:15 AM
User rating and feedback form Mark ASP .Net 0 09-09-2004 07:07 AM
Feedback Form ASP & ASP.NET Mohamed Hosam ASP .Net 1 02-18-2004 11:22 AM



Advertisments
 



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