LabelWarning.Text += "<li>Fund: " + dr["CltAcctNo"].ToString() + ", Security: "
+ dr["SecFullName"].ToString() + ", Expected holdings: " + share.formatQty(dr["ExpHoldings"].ToString(), dr["DecPlaces"].ToString())
+ ", Calculated holdings: " + share.formatQty(dr["CalHoldings"].ToString(), dr["DecPlaces"].ToString()) + "</li>";
由于XSS(跨站脚本)导致此代码出现问题,是否有解决此问题的想法?
答案 0 :(得分:0)
你也可以在搜索引擎上找到这个答案:
LabelWarning.Text += "<li>Fund: " + System.Web.HttpUtility.HtmlEncode(dr["CltAcctNo"].ToString()) + ", Security: "
+ System.Web.HttpUtility.HtmlEncode(dr["SecFullName"].ToString()) + ", Expected holdings: " + System.Web.HttpUtility.HtmlEncode(share.formatQty(dr["ExpHoldings"].ToString(), dr["DecPlaces"].ToString()))
+ ", Calculated holdings: " + System.Web.HttpUtility.HtmlEncode(share.formatQty(dr["CalHoldings"].ToString(), dr["DecPlaces"].ToString())) + "</li>";