This article is a mirror article of machine translation, please click here to jump to the original article.

View: 20338|Reply: 0

[Source] In the GridView control, the text content displays the full html source code

[Copy link]
Posted on 5/23/2015 12:41:31 PM | | | |


If there are records in the database with html markup language, the text with html attributes will be displayed in the page, how to make all records complete without html tags

What about the show?

Method 1:

Directly in the web interface: Server.HtmlEncode(srt);  Calling this method,

Method 2:

If there is no such method in the class,

Workaround: Reference using System.web;

Then do the encoding conversion System.Web.HttpUtility.HtmlEncode(str);

Solved!





Previous:C# intercepts the length of the string string in 3 ways
Next:Can Android be unlocked with a fingerprint? Google will release Android M: native support for fingerprint recognition
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com