Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to email and insert a form in one submit?

How to email and insert a form in one submit?

Scheduled Pinned Locked Moved ASP.NET
helpjavascriptdatabasetutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    proxi79
    wrote on last edited by
    #1

    Hi All, I'm quite new in the world of ASP & Javascript. For the moment I encounter the following problem: I've a form with some textfields which I need to send/submit at the end, this event invokes an email to the requestor & an insert into an access database. Doing both separetely works fine, however I don't succeed in combining both actions with one submit-statement! I've been playing around already since several hours (even days) but till now I didn't find anything that works fine... :( Can some of you provide some help? Best regards, Proxi79

    J 1 Reply Last reply
    0
    • P proxi79

      Hi All, I'm quite new in the world of ASP & Javascript. For the moment I encounter the following problem: I've a form with some textfields which I need to send/submit at the end, this event invokes an email to the requestor & an insert into an access database. Doing both separetely works fine, however I don't succeed in combining both actions with one submit-statement! I've been playing around already since several hours (even days) but till now I didn't find anything that works fine... :( Can some of you provide some help? Best regards, Proxi79

      J Offline
      J Offline
      jszpila
      wrote on last edited by
      #2

      You should put something like this in your code: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'this checks to see if the page has been posted back, i.e. submit has been clicked If IsPostBack Then Try MyInsertFunction() 'calls your insert function MyEmailFunction() 'calls your email function Catch ex As Exception Response.Write(ex) 'if either of the above operations fail, this will tell you the error End Try End If End Sub Alternately, you can place that try/catch block inside of your submit button click event handler instead of Page_Load. Hope that helps. ------------------- abort, retry, fail?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups