html标记<变为<?
html标记变成<??我在后台写的是“”,然后把它输出到前台就变成<了~~这个问题怎么解决啊?[解决办法]
html标记<变成<??
我在后台写的是“<”,然后把它输出到前台就变成"<"了~~这个问题怎么解决啊?
[解决办法]
绑定控件,设置HtmlEncode="false"即可
[解决办法]
[解决办法]<asp:BoundField HtmlEncode="false"
[解决办法]server.htmldecode();
[解决办法]这样
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Text = Server.HtmlDecode(e.Row.Cells[0].Text);
}
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="formd1" runat="server">
<asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound">
</asp:GridView>
</form>
</body>
</html>