2013-11-04 34 views
0

我越來越在aspx頁面預期「)」

頁面加載成功,但在

的.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事件自動添加,這背後的任何問題?

任何想法?在此先感謝

+2

「完成時出現錯誤」通常意味着存在腳本問題(JavaScript)而非ASP.NET問題 - 如果這是問題,頁面根本無法編譯。 – James

+0

問題肯定出現在這個字符串中:SelectAll(ctl00_PageMainContent_filterPane_content_chklstCourse ',EBI/DVM的高級網絡);因爲系統爲什麼將「'」編碼爲'。你應該提供與chklstCourse相關的condebehind。 – Agat

回答

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); 

第二個參數看起來像一個字符串,但它們沒有被引用。