Escape text for HTML

后端 未结 9 884
别那么骄傲
别那么骄傲 2020-11-28 04:50

How do i escape text for html use in C#? I want to do

sample=\"blah\"

and have

blah&l         


        
9条回答
  •  自闭症患者
    2020-11-28 05:31

    You can use actual html tags

    </code> and <code> to output the string as is to show all of the tags in between the xmp tags.

    Or you can also use on the server Server.UrlEncode or HttpUtility.HtmlEncode.

提交回复
热议问题