3

As of ASP.net MVC 2 RC, there have been Async Controller available. There also various of ways and practice to make the async Controller.

For example:

  1. http://msdn.microsoft.com/en-us/library/ee728598(VS.100).aspx
  2. http://www.ducdigital.com/2009/12/24/builtin-async-controller-in-asp-net-mvc-2/
  3. http://weblogs.asp.net/seanmcalinden/archive/2009/11/15/asynchronous-processing-in-asp-net-mvc-with-ajax-progress-bar.aspx

for the first one, it is good to separate the module service with the controller, but there are some problem with the length to just do a method. For example, i want to have 2 method, which process differently and have different input like:

public void Test(string a) public string Test(string a, string b)

I will have to end up rewrite everything (IMO).

for the 2nd, it's good, and fast to write, we can easily turn a normal method into a Async method. But it might be not a good solution in some way.

What's your suggest of doing async controller. I could prioritize the shortness of a code (shorter = less bug), and also the one that can easily write as class module / plugin class (separate from main MVC code)

Please give your best advice :)

1 Answer 1

1

There's a great article on Async Controllers by Dino Esposito. You can read it here: http://dotnetslackers.com/articles/aspnet/testing-asynchronous-methods-in-asp-net-mvc.aspx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.