[英]How to debug an aspx page, keeps saying page not found when there is an error
我有一個帶有listview的頁面,並且存在一些問題,但是當我運行它時,我得到了404資源未找到錯誤,而不是出錯。 如果我刪除有問題的listview並運行,那么它將運行正常,因此,如果不在正確的頁面上等位置查找就不會有問題。我現在如何才能確定listview的錯誤所在?由於沒有任何信息,它甚至可以在設計視圖中正確呈現。
非常感謝
有關信息,請參見下面的代碼,但是我需要知道如何調試它,因為以前已經發生過很多次了。
如果我刪除此列表視圖,則該頁面有效。
<asp:ListView ID="lvPerformanceKPIs" runat="server"
OnItemDataBound="lvPerformanceKPIs_ItemDataBound" DataKeyNames="PerformanceMeasureID"
OnItemCommand="lvPerformanceKPIs_ItemCommand" ItemPlaceholderID="itemPlaceholder"
>
<LayoutTemplate>
<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<th width="5%" class="Actions" >
Actions
</th>
<th width="2%" > 
</th>
<th width="5%">
ID
</th>
<th width="28%">
Group
</th>
<th width="40%">
Indicator
</th>
<th width="20%">
Threshold
</th>
</tr>
</table>
<div runat="server" id="itemPlaceHolder">
</div>
</LayoutTemplate>
<ItemTemplate>
<div id="Div1" class="SUBDIV" runat="server">
<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="5%" class="Actions">
<%--<img id="btnEdit" style="cursor: pointer;" alt="Edit" title="Edit this record" src="images/edit.png" width="15px"
onclick="CRMEdit(this);"/>
<asp:ImageButton ID="btnDelete" runat="server" title="Delete this record" src="images/delete.png" width="15px"
OnclientClick="return confirm('Are you sure you want to delete this record?')"
CommandName="cmdDelete" CommandArgument=<%#Eval("PerformanceMeasureID") %> /> --%>
</td>
<td width="2%">
<div class="btncolexp collapse" title="Expand to reveal/add files">
</div>
</td>
<!-- id columns to get values then will be hidden with jquery -->
<td class="hidCol">
<span id="itemServiceSpecID"><%#Eval("ServiceSpecID")%></span>
</td>
<td class="hidCol">
<span id="itemPerfSortOrder"><%#Eval("PerfSortOrder")%></span>
</td>
<td class="hidCol">
<span id="itemPerfType"><%#Eval("PerfType")%></span>
</td>
<td class="hidCol">
<span id="itemPerfFrequency"><%#Eval("PerfFrequency")%></span>
</td>
<td width="5%">
<span id="itemPerformanceMeasureID"><%#Eval("PerformanceMeasureID")%></span> 
</td>
<td width="28%">
<span id="itemPerfGroup"><%#Eval("PerfGroup")%></span> 
</td>
<td width="40%">
<span id="itemPerfMeasure"><%#Eval("PerfMeasure")%></span> 
</td>
<td width="20%">
<span id="itemPerfThresholdText"><%#Eval("PerfThresholdText")%></span> 
</td>
</tr>
</table>
</div>
</ItemTemplate>
</asp:ListView>
我想知道這些圖像是否在項目模板中正確注釋掉了。 確保注釋標記(<%--%>)和數據綁定標記之間沒有沖突。
同樣,CommandArgument需要用引號引起來:
CommandArgument='<%#Eval("PerformanceMeasureID") %>'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.