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?
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.
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
Untick "Render content in editor" in developers -> macros -> macro
Also to make sure its doesn't send it on a postback wrap your code in
Hi, Skiltz, thanks for reply. I tried all your suggestion, it does not work. Now I am getting triple emails. :(
Is this when viewing the public side of the page or from within Umbraco?
when viewing public side. thanks
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.
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
I've experienced the same issue & found out it was firebug loading the page twice.
Claire - thanks! I was going nuts with this, testing some code and everything was happening twice.. :0))
is working on a reply...