Razor是否支持html片段刷新? [英] Does Razor support html fragments flushing?

查看:57
本文介绍了Razor是否支持html片段刷新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚阅读了此有趣的帖子在Patrick Steel-Idem编写的性能日历上.帖子基本上描述了一种将html片段刷新到浏览器的方法,以缩短感知的加载时间.它显示出,通过向浏览器发送html的小片段,它可以开始进行详细说明,并可以更早地提出请求.Patrick在他的示例中使用nodejs,并使用Marko作为模板引擎.

I just read this interesting post on perf calendar written by Patrick Steel-Idem. The post basically describes a way of flushing html fragments to browser, in order to improve the perceived loading time; it shows, as by sending the browser little fragments of the html, it can start its elaboration, and further requests earlier. In his example Patrick works with nodejs, and uses Marko as templating engine.

我的问题是:由于我拥有完全不同的堆栈(asp.net mvc5),您知道一种使用Razor作为模板引擎来实现相同结果的方法吗?你能指出我正确的资源吗?

My question is: since I have a completely different stack (asp.net mvc5) do you know a way to achieve the same results using Razor as templating engine? Can you point me to the right resources?

谢谢

推荐答案

正如Jason Evans和Andy Nichols指出的那样,Razor并没有内置任何东西来支持这一点,但是有一些解决方法.

As Jason Evans and Andy Nichols point out there is isn't anything built into Razor to support this but there are workarounds.

但是,MVC 6具有新的关键字 FlushAsync()可以满足此要求.

However MVC 6 has a new keyword FlushAsync() to address this requirement.

@await FlushAsync()

这篇关于Razor是否支持html片段刷新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆