SyntaxError:标识符在数字文字asp.net之后立即启动

时间:2014-11-16 14:48:54

标签: javascript c# jquery html asp.net

当我点击以下链接时,我收到javascript错误:

SyntaxError: identifier starts immediately after numeric literal

通过萤火虫:


<a href="javascript:void(0)" onclick="SubmitWithLog('HR','https://hr.test/hr/index.aspx?enc=ae%734II-.l%60%22%2c%sm67%1b'%3546bnv%2b!%1tyu)MQR%780%01%16LVWP%3b0M7ghnz%ef%bf%523jd%3b','#ctl273')" id="ctl562_ctrl11_hl_sys">HR</a>

我的.cs:

 void hl_DataBinding(object sender, System.EventArgs e)
                {
                    HtmlGenericControl hl = (HtmlGenericControl)sender;

                    hl.InnerText = ((hl.NamingContainer as RadListViewDataItem).DataItem as DataRowView)["name"].ToString().TrimEnd();

                    string winURL = ((hl.NamingContainer as RadListViewDataItem).DataItem as DataRowView)["url"].ToString().TrimEnd();

                    HashSet<string> frmId = ((HashSet<string>)parent.Context.Session["blocks"]);
                    for (int i = 0; i < frmId.Count; i++)
                    {
                        if (frmId.ElementAt(i).Split('|')[1] == winURL)
                        {
                            hl.Attributes["onclick"] = "SubmitWithLog('" + hl.InnerText + "'" + "," + "'" + frmId.ElementAt(i).Split('|')[1] + frmId.ElementAt(i).Split('|')[2] + "'" + "," + "'#" + frmId.ElementAt(i).Split('|')[0].Trim() + "')";
                            hl.Attributes["href"] = "javascript:void(0)";
                            break;
                        }

                    }


                }

1 个答案:

答案 0 :(得分:1)

也许第二个参数会提早停止?

'HR','https://hr.test/hr/index.aspx?enc=ae%734II-.l%60%22%2c%sm67%1b'

即。字符串里面有一个单引号字符。