我正在一个名为 as 的表上实现全文搜索,该表tbljobs名为jobdescription. 在前端,我在描述中获得了 html 标签。我正在显示记录,GridView我Gridview正在RowDataBound解码文本。我在Gridview'sRowDataBound事件中使用以下代码:
protected void GridNewlyPostedJobs_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string decodedText = HttpUtility.HtmlDecode(((Label)e.Row.FindControl("lblJobDescription")).Text);
((Label)e.Row.FindControl("lblJobDescription")).Text = decodedText;
}
}
但没有任何效果..!!