我在 msdn 中看到了MvcHtmlString,但我有一个关于编码的问题。
编码和解码值到底是什么Encode ASP.Net MVC
以及有什么区别?
我在 msdn 中看到了MvcHtmlString,但我有一个关于编码的问题。
编码和解码值到底是什么Encode ASP.Net MVC
以及有什么区别?
Some characters must be encoded to ensure proper display. For instance <
and >
are special characters that tell the browser that the text between the two is an HTML tag and must be interpreted as part of the markup. To be able to display <
and >
as part of the text, it must be encoded. HTML encoding will substitute these with <
and >
respectively. The browser then knows it's not part of the markup and displays it accordingly.
Decoding is the other way around: <
becomes <
, &
becomes &
, etc.