I have the following code:
lblMetaTag.Text =
"<meta property='" + ctrl.property_name +
"' content='" + ctrl.property_value + "' />";
When it renders to the page - it renders the meta tag and not the string representation.
How do I display it as the string?
Change it to the following:
lblMetaTag.Text =
"< ;meta property='" + ctrl.property_name + "' content='" +
ctrl.property_value + "' /> ;";
在将其发送到您的页面之前使用HTML编码。
This this
lblMetaTag.Text = Server.HtmlEncode(
"<meta property='" + ctrl.property_name +
"' content='" + ctrl.property_value + "' />");
Hope this helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.