我已经潜伏了大约一个小时试图找到解决方案或模式来做到这一点(标题参考)。让我举个例子来说明我的意思:
Client-to-Server: Hey, I want information about "ww2" //using jquery's ajax .post() method
Server-to-Client: Ok, got your request, prepare to receive data asynchronously.
Server-to-Client: "World War II happen in 1939 to 1945"
//after couple of seconds
Server-to-Client: "The Alliance won the war."
//some more delay
Server-to-Client: "bla bla bla"
Server-to-Client: "thats it, im done for now".
现在显然客户端将在使用 jquery 接收到数据后立即显示数据。我的主要问题是,我怎样才能在服务器上调用 aHttpPOST
并异步Action
返回许多s?PartialView
如果样品有任何其他方式/想法,将不胜感激。