How do I call an asynchronous process from an asp.net hosted module using C#5 async / await?

后端 未结 2 1629
你的背包
你的背包 2021-01-16 19:15

I have a long running process that is called via a Nancy Module Get method. Rather than have the browser hang while the process runs I would like this call to be asynchronou

2条回答
  •  忘掉有多难
    2021-01-16 19:56

    try setting the page attribute Async="true"in the aspx page after doing that it wold look like this <%@ Page Language="C#" AutoEventWireup="true" CodeFile="XXX.aspx.cs" Inherits="xxx" Async="true" %>

    the in tcode behile file you can make the tasks and methods of type async and calll await tasks from them ...

    it might work

提交回复
热议问题