feedback form using ASP.NET and VB.NET

Discussion in 'ASP .Net' started by Mario Krsnic, May 29, 2006.

  1. Mario Krsnic

    Mario Krsnic Guest

    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
    Mario Krsnic, May 29, 2006
    #1
    1. Advertising

  2. 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
    >
    >
    >
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, May 29, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mohamed Hosam

    Feedback Form ASP & ASP.NET

    Mohamed Hosam, Feb 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    959
    Itai Raz
    Feb 18, 2004
  2. Mark

    User rating and feedback form

    Mark, Sep 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    336
  3. Mindful_Spirit
    Replies:
    2
    Views:
    351
    Mindful_Spirit
    Jul 14, 2004
  4. Katie
    Replies:
    1
    Views:
    108
    Katie
    Jul 11, 2006
  5. LaMoRt

    Feedback form using cgi script

    LaMoRt, Aug 14, 2007, in forum: Perl Misc
    Replies:
    5
    Views:
    88
    Gunnar Hjalmarsson
    Aug 14, 2007
Loading...

Share This Page