database text with html formatting, how to pull it into my asp.net page

你离开我真会死。 提交于 2019-12-13 07:36:57

问题


I have content that I want to load dynamically, the problem is it has some html formatting in it. What control should i pull the text into, is there a way to pull the text into a div or a label, along with the formatting?


回答1:


You can use an asp:Literal:

Code behind:

myLiteral.Text = HtmlDecode(GetTextFromDB())



来源:https://stackoverflow.com/questions/4760788/database-text-with-html-formatting-how-to-pull-it-into-my-asp-net-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!