title: Mark page as "async = true" for a Visual Studio MVC Project
body: <p>I am using Edge.js so that I can call Node.js from C#. According to the documentation in the link I would do that similar to the following:</p>
  
  <pre><code>[HttpPost]
  public ActionResult Input(InputModel obj)
  {
     validateInput(obj);
     return View();
  }
  
  private async void validateInput(object obj)
  {
       var func = Edge.Func(@"
  
          return function (data, callback){
              var username    =   data.username,
              email           =   data.email;
  
              callback(null, username);
          }
  
           ");
  
           ViewBag.Msg = (string)await func(obj);
  }
  </code></pre>
  
  <p>However, I get the following run time error:</p>
  
  <pre><code>    Additional information: An asynchronous operation cannot be started at this time. 
  Asynchronous operations may only be started within an asynchronous handler or module or during 
  certain events in the Page lifecycle. If this exception occurred while executing a Page, ensure that the 
  Page is marked &lt;%@ Page Async="true" %&gt;. This exception may also indicate an attempt to call an 
  "async void" method, which is generally unsupported within ASP.NET request processing. Instead, 
  the asynchronous method should return a Task, and the caller should await it.
  </code></pre>
  
  <p>My question is two-fold:</p>
  
  <p>1.How do I make the page, async=true. I know how to do this for a web forms project but not a MVC project.</p>
  
  <p>2.Is there a better way to do what I am trying to do? A red flag will probably go up when you see that I am returning void however this is do to the fact that Edge.js is being used. Even so, I have tried returning a <code>Task</code> and then <code>task.Wait()</code> in the calling method but the task never finishes.</p>