什么是HTML.Raw办? [英] What does HTML.Raw do?

查看:138
本文介绍了什么是HTML.Raw办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML.raw()具体到MVC?在什么情况下,我们必须使用它?

Is HTML.raw() specific to MVC? On what scenarios we have to use it?

能否请您用一个例子来解释。

Can you please explain with an example.

推荐答案

文本输出通常是HTML EN codeD。使用Html.Raw允许您包含HTML元素到客户端的输出文本,并将它们仍然被渲染成这样。应谨慎使用,因为它暴露了你跨站点脚本漏洞。

Text output will generally be HTML encoded. Using Html.Raw allows you to output text containing html elements to the client, and have them still be rendered as such. Should be used with caution, as it exposes you to cross site scripting vulnerabilities.

这篇关于什么是HTML.Raw办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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