? orus casino? bodog? ruleta? luckia? betano? sportium? spin casino? stakes? 3 reyes? 888? lottoland? coolbet? 777 casino? gana777? betfair? bwin? yak casino? ivy casino? oddschecker? red casino? netbet? william hill? vip casino? rey casino? marathonbet? dafabet? sol casino? 1bet? winland? bet777? parimatch? 18bet? 888casino? campobet? mostbet? ganabet? rushbet? betcris? betsson? lucky? novibet? winner? winpot? betmaster? betmexico? cancun? playcity? strendus? pokerstars? codere? caliente? fun88? bbrbet? 1win? 10bet? betway? pin up? spinbet? 7cslot? pickwin? spin bet? mr fortune? w88? pragmatic? gamdom? crasher? jojobet? betmex? bcasino? foliatti? winner mx? bets 10? big bola? bet master? inbet? 7slots? lucky day? m777? mexplay? luckydays? bet caliente? 1x? plinko

Forum


HomeHomePremiumPremiumDevelopmentDevelopmentAsync Calls in ModuleAsync Calls in Module
Previous
 
Next
New Post
5/13/2014 8:28 AM
 

I am experimenting around how to handle an issue with a slow SMTP server.  I tried to use the .SendAsync() method of the SmtpClient.  When I did this I ran into an error that upon researching can be solved by adding Async="True" to the <%@Page ..... %>.

The problem I have is that I am working in modules, controls, and ascx files that don't have the <%@ Page %> so I put it in the Default.aspx file of the DNN project.  This works and allowed me to use the asynchronous function call.  Although it worked, this doesn't seem right because I went into the DNN core and made a change that will be overwritten if I update DNN.  I haven't seen any yet, but I am also worried about side effects on other parts of the site with this change.  Does anyone know if I should expect problems?

I think I'm going about this wrong.  Is there a better way to use the .SendAsync() method in modules?

 
New Post
5/13/2014 2:41 PM
 

Andy,

I don't have much experience with the Page Async directive, but another way to do async tasks is to use the System.Threading.Tasks in .NET 4+

IE:

var taskEmail = System.Threading.Tasks.Task.Factory.StartNew(() =>
{
    DotNetNuke.Services.Mail.Mail.SendEmail(msg.From, msg.From, msg.To, msg.Subject, msg.Body, msg.Attachments);
})

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentAsync Calls in ModuleAsync Calls in Module



Try FREE
30 days money back guaranteed