如何将html数据插入数据库 [英] how can insert html data into database
本文介绍了如何将html数据插入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人
我要在asp.net中创建一个迷你博客项目
我在项目中遇到了一些问题
1-当我在数据中插入任何编程文本时
当我将这些数据显示在列表视图或标签中时,它不会作为文本反应
这会生成html代码
像-如果我插入dropdwon列表代码,则此代码显示为dropdwon而不显示为文本
我想将数据显示为文本格式
Dear all
i m create a mini blog project in asp.net
i faces some problem in project
1-when i insert any programming text into data
and when i show this data into list view or lable this is not react as text
this generate html code
like-if i insert dropdwon list code this show in lable as dropdwon not react as text
i want to show data into text format
推荐答案
这听起来像您想将html显示为文本,因此遵循这种风格
this sounds like you want to display html as text, for that follow this style
<asp:Literal runat="server" Text = "<select><option>option1</option><option>option2</option></select>" Mode=Encode ></asp:Literal>
让我知道这是否行不通.
let me know if this doesn''t work.
<asp:DataList ID="DataList1" runat="server" CellPadding="4" ForeColor="#333333"
Width="115px" >
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "EmpId")%>
<asp:Literal runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "EmpHtml")%>' Mode=Encode></asp:Literal>
</ItemTemplate>
</asp:DataList>
并传递EmpHtml html文本
and pass the EmpHtml html text
这篇关于如何将html数据插入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文