简体   繁体   中英

add html (for a copyable embed code) that displays as string not html

My website produces and object that I would like to allow my users to "embed" - I have an api url for retrieving parameters etc. - however, when I try to write the embed code to a label it simply shows an embed object, rather than the code.

How can I just return the html code as a string, rather than as html so the user sees the code, not the object? (Using c#)

edit

Just clarifying per the request - I am expecting the user to see embed code: ie the string: "<" embed src='myAPIURL?thispageID' height='300' width='800'>" but instead that object is being embedded in the page.

I'm writing to to a label at present.

尝试用“&lt;”“&gt;”转义“ <”和“> “&gt;”

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM