0

Can you suggest me how I can do async operations with asp.net MVC

kaivalya
  • 3,829
  • 9
  • 34
  • 43

3 Answers3

1

EDIT

the answer below is outdated. AsyncController has been part of ASPNET MVC since v2.

A cursory search of the internet indicates that async processing is not currently part of MVC, but it is possible to roll your own:

http://blog.codeville.net/2008/04/05/improve-scalability-in-aspnet-mvc-using-asynchronous-requests/

Using such a pattern would then allow you to perform other async operations without tying up a thread.

EDIT:

Or perhaps this near dupe question solves your problem?

How to send an email with attachments using SmtpClient.SendAsync?

Community
  • 1
  • 1
spender
  • 117,338
  • 33
  • 229
  • 351
0

The same way as with any other platform... the fact that you're using ASP.NET MVC doesn't change anything to the way SmtpClient works. If it doesn't work, it's probably not due to ASP.NET MVC...

Thomas Levesque
  • 286,951
  • 70
  • 623
  • 758
-1

The reseaon why not work because the close of mvc work process cancels sending the email. It's nature of MVC life cycle. You have to use another way.

user543518
  • 51
  • 1
  • 2