gpt4 book ai didi

asp.net-mvc-2 - 返回 html 内容时使用的 MVC ActionResult

转载 作者:行者123 更新时间:2023-12-03 03:41:30 25 4
gpt4 key购买 nike

我的内存中有一些 html 片段,需要使用 RenderAction 进行渲染。例如我的操作方法看起来像这样:

var html = "一些html代码

如何使用 RenderAction 让它渲染此 html,我不想创建 View 文件,因为这是动态 html。我无法使用任何文件结果,因为这不是来自文件。还有什么其他方法可以实现这一目标?

最佳答案

查看ContentViewResult,或快捷方式return Content(string html)

关于asp.net-mvc-2 - 返回 html 内容时使用的 MVC ActionResult,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3557062/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com