HTMLEncode
The HTMLEncode method applies HTML encoding to a specified string. SyntaxServer.HTMLEncode( string )
Parameters string
Specifies the string to encode.
ExampleThe following script<%= Server.HTMLEncode("The paragraph tag: <P>") %>
produces the outputThe paragraph tag: <P>
Note The preceding output will be displayed by a Web browser as The paragraph tag: <P>
If you view source, or open the page as a text file, you will be able to see the encoded HTML.
The HTMLEncode method applies HTML encoding to a specified string. SyntaxServer.HTMLEncode( string )
Parameters string
Specifies the string to encode.
ExampleThe following script<%= Server.HTMLEncode("The paragraph tag: <P>") %>
produces the outputThe paragraph tag: <P>
Note The preceding output will be displayed by a Web browser as The paragraph tag: <P>
If you view source, or open the page as a text file, you will be able to see the encoded HTML.
2、neirong2.Replace(" "," ");是把空格转化为html中的空格