0

我收到一个错误“预期')'”

该页面已成功加载,但在浏览器页脚状态“完成但有错误”

.aspx

<td align="left" valign="top" style="width: 18%;">
   <div id="Div2" style="overflow:auto;height:120px;">
       <asp:CheckBoxList ID="chklstCourse" DataTextField="CourseName" DataValueField="CourseName" runat="server"></asp:CheckBoxList>
   </div>
</td>

<td align="left" valign="top" style="width: 18%;">
    <div id="Div4" style="overflow:auto;height:120px;">
       <asp:CheckBoxList ID="chklstCategory" DataTextField="Category" DataValueField="Category" runat="server"></asp:CheckBoxList>
    </div>
</td>
<td align="left" valign="top" style="width: 18%;">
    <div id="Div5" style="overflow:auto;height:120px;">
         <asp:CheckBoxList ID="chklstSubCat" DataTextField="SubCategory" DataValueField="SubCategory" runat="server"></asp:CheckBoxList>
    </div>
</td>

查看源代码:

<tr>
                <td><input id="ctl00_PageMainContent_filterPane_content_chklstCourse_0" type="checkbox" name="ctl00$PageMainContent$filterPane_content$chklstCourse$0" checked="checked" onclick="SelectAll(&#39;ctl00_PageMainContent_filterPane_content_chklstCourse&#39;,0);" /><label for="ctl00_PageMainContent_filterPane_content_chklstCourse_0">Select All</label></td>
            </tr><tr>
                <td><input id="ctl00_PageMainContent_filterPane_content_chklstCourse_1" type="checkbox" name="ctl00$PageMainContent$filterPane_content$chklstCourse$1" checked="checked" onclick="SelectAll(&#39;ctl00_PageMainContent_filterPane_content_chklstCourse&#39;,7 Habits of Highly Effective People);" /><label for="ctl00_PageMainContent_filterPane_content_chklstCourse_1">7 Habits of Highly Effective People</label></td>
            </tr><tr>
                <td><input id="ctl00_PageMainContent_filterPane_content_chklstCourse_2" type="checkbox" name="ctl00$PageMainContent$filterPane_content$chklstCourse$2" checked="checked" onclick="SelectAll(&#39;ctl00_PageMainContent_filterPane_content_chklstCourse&#39;,Advanced Networking for EBI/DVM);" /><label for="ctl00_PageMainContent_filterPane_content_chklstCourse_2">Advanced Networking for EBI/DVM</label></td>
            </tr><tr>

在自动添加checkboxlist控件的onclick事件中查看源代码,这背后有什么问题吗?

有任何想法吗?提前致谢

4

1 回答 1

0

这两个函数调用中的第一个参数用引号 ( &#39;) 括起来,第二个参数也需要吗?

SelectAll(&#39;ctl00_PageMainContent_filterPane_content_chklstCourse&#39;,Advanced Networking for EBI/DVM);
SelectAll(&#39;ctl00_PageMainContent_filterPane_content_chklstCourse&#39;,7 Habits of Highly Effective People);

第二个参数看起来像一个字符串,但它们没有被引用。

于 2013-11-04T10:38:37.697 回答