简体   繁体   English

如何在chrome中找到编码的html值?

[英]How to find encoded html value in chrome?

From Microsoft Docs来自Microsoft 文档

The Razor engine used in MVC automatically encodes all output sourced from variables So for the following razor view MVC 中使用的 Razor 引擎自动编码来自变量的所有输出所以对于以下剃刀视图

@{
    var untrustedInput = "<\"123\">";
}

@untrustedInput

This view should output the contents of the untrustedInput variable.此视图应输出untrustedInput变量的内容。 This variable includes some characters which are used in XSS attacks, namely <, " and >.该变量包括一些用于 XSS 攻击的字符,即 <、" 和 >。

So my expectation was browser source code will show the encoded value as: &lt;&quot;123&quot;&gt;所以我的期望是浏览器源代码将编码值显示为: &lt;&quot;123&quot;&gt;

But instead I see the rendered value但相反,我看到了渲染值
在此处输入图像描述

Where would I actually see the encoded value in the browser?我实际上会在浏览器中的哪里看到编码值?

Sorry I found it.抱歉我找到了。 I am looking at the wrong tab.我在看错误的标签。 If i open Network->my route->Response Tab.如果我打开网络->我的路线->响应选项卡。 I see the encoded value我看到编码值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM