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. ASP.NET 2.0 button click to perform 2 actions (client side e-mail then redirect to another page)

ASP.NET 2.0 button click to perform 2 actions (client side e-mail then redirect to another page)

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomtutorial
3 Posts 3 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.
  • B Offline
    B Offline
    bubberz
    wrote on last edited by
    #1

    I have a button click and what I need to do is too things: 1. Send an email to the value of what was selected from a required dropdown list of people 2. Then send the user to another page. I wanted to do both of these in the code behind, and it's been decided the application owner (person who's funding the application) would like to use the client's email application (ie. Eudora, Outlook, etc.) when sending this email. I'm not sure how to replicate the href='mailto:person@person.com' that's possible with the anchor tag.

    J 1 Reply Last reply
    0
    • B bubberz

      I have a button click and what I need to do is too things: 1. Send an email to the value of what was selected from a required dropdown list of people 2. Then send the user to another page. I wanted to do both of these in the code behind, and it's been decided the application owner (person who's funding the application) would like to use the client's email application (ie. Eudora, Outlook, etc.) when sending this email. I'm not sure how to replicate the href='mailto:person@person.com' that's possible with the anchor tag.

      J Offline
      J Offline
      Jesse Squire
      wrote on last edited by
      #2

      What you may consider doing is adding a client-side click handler that opens the mailto link in a new window. So long as you don't return false from the client event, then your server-side Click event will still fire so that you can call your redirect there. For example:

      <asp:Button  ID = "test"

      OnClick = "Button_Click"

      OnClientClick = "window.open('mailto:user@server.ext'); return true;"

      Text = "Click Me"

      runat = "server"/>

      Hope that helps. :)

      --Jesse

      N 1 Reply Last reply
      0
      • J Jesse Squire

        What you may consider doing is adding a client-side click handler that opens the mailto link in a new window. So long as you don't return false from the client event, then your server-side Click event will still fire so that you can call your redirect there. For example:

        <asp:Button  ID = "test"

        OnClick = "Button_Click"

        OnClientClick = "window.open('mailto:user@server.ext'); return true;"

        Text = "Click Me"

        runat = "server"/>

        Hope that helps. :)

        --Jesse

        N Offline
        N Offline
        Neeraj Arora
        wrote on last edited by
        #3

        Wonderful

        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