Razor是否支持html片段刷新?

编程入门 行业动态 更新时间:2024-10-23 11:18:06
本文介绍了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 mvc5),您知道一种使用Razor作为模板引擎来实现相同结果的方法吗?你能指出我正确的资源吗?

My question is: since I have a completely different stack (asp 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片段刷新?

本文发布于:2023-10-16 05:37:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1496650.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:片段   Razor   html

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!