未捕获的SyntaxError:无效的正则表达式:缺少/

时间:2015-01-31 16:48:28

标签: c# html asp.net .net

我有一个像这样的TableCell:

<asp:TableCell CssClass="plusTd button" ID="plusCell">
                        </asp:TableCell>

我为它添加了一个属性:

plusCell.Attributes.Add("onclick", "/Add.aspx");

当我点击那个单元格时,我在控制台上出现了这个错误:

Uncaught SyntaxError: Invalid regular expression: missing /

我错过了什么?

1 个答案:

答案 0 :(得分:0)

要重定向点击事件,请使用此

plusCell.Attributes.Add("onclick", "window.location='/Add.aspx'");
相关问题