Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jing Ling 9 posts 29 karma points
    Nov 06, 2009 @ 01:45
    Jing Ling
    0

    Umbraco web page been loaded more than once

    Hi All. I am using Umbraco 4.0.2.1. I currently created a user control which is used to send out email in the page load event. However, after I put the macro into umbraco page, everytime I access this page, the send mail function is be called more than once, which means I receive more than one email. Can anyone help me about this?

    Cheers

  • skiltz 501 posts 701 karma points
    Nov 06, 2009 @ 02:33
    skiltz
    0

    Untick "Render content in editor" in developers -> macros -> macro

  • skiltz 501 posts 701 karma points
    Nov 06, 2009 @ 02:35
    skiltz
    0

    Also to make sure its doesn't send it on a postback wrap your code in

    if(!Page.IsPostBack)
    {
    //do emai sending here.
    }
  • Jing Ling 9 posts 29 karma points
    Nov 06, 2009 @ 03:22
    Jing Ling
    0

    Hi, Skiltz, thanks for reply. I tried all your suggestion, it does not work. Now I am getting triple emails. :(

  • skiltz 501 posts 701 karma points
    Nov 06, 2009 @ 03:42
    skiltz
    0

    Is this when viewing the public side of the page or from within Umbraco?

  • Jing Ling 9 posts 29 karma points
    Nov 06, 2009 @ 05:06
    Jing Ling
    0

    when viewing public side. thanks

  • skiltz 501 posts 701 karma points
    Nov 06, 2009 @ 07:07
    skiltz
    0

    It really must be some of the code in your UserControl, its highly unlikely to be anything to do with Umbraco. Without seeing your I'm not really sure.  If your running your site locally you could debug your user control, put a breakpoint on the bit where its sends the email and see why its being hit 3 times. 

  • Jing Ling 9 posts 29 karma points
    Nov 08, 2009 @ 23:26
    Jing Ling
    0

    HI Skitz. I checked my code in user control and can not find any problem. Actully, it is very simple:

    if (!Page.IsPostBack)
    {

        sendEmail();

    }

    and it sends me same email twice. Can you think any other reason?

     

    Thanks

  • Claire Botman 48 posts 77 karma points
    Nov 08, 2009 @ 23:43
    Claire Botman
    0

    I've experienced the same issue & found out it was firebug loading the page twice.

  • Thomas 49 posts 78 karma points c-trib
    Nov 03, 2011 @ 10:54
    Thomas
    0

    Claire - thanks! I was going nuts with this, testing some code and everything was happening twice.. :0))

     

Please Sign in or register to post replies

Write your reply to:

Draft