简体   繁体   中英

How to debug an aspx page, keeps saying page not found when there is an error

I have a page with a listview and there is some problem with it, however instead of getting an error, when I run it I get a 404 resource not found error. If I remove the offending listview and run then it runs fine, so it is not an issue with it not looking in the right place for the page etc. How can I find out what the error is with the listview, at the moment I'm getting no information about it, it even renders correctly in design view.

Many thanks

For info the code is below, however I need to know how to debug it as this has happened lots of times before.

If I remove this listview the page works..

<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%" >&nbsp
                    </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">
                                &nbsp;
                            </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>&nbsp
                        </td>
                        <td width="28%">
                            <span id="itemPerfGroup"><%#Eval("PerfGroup")%></span>&nbsp
                        </td>
                        <td width="40%">
                            <span id="itemPerfMeasure"><%#Eval("PerfMeasure")%></span>&nbsp
                        </td>
                        <td width="20%">
                            <span id="itemPerfThresholdText"><%#Eval("PerfThresholdText")%></span>&nbsp
                        </td>
                    </tr>          
                </table>
            </div>
        </ItemTemplate>
    </asp:ListView>      

i wonder if those images are properly commented-out in the item template. make sure there is no conflict between the comment tags (<%-- --%>) and the data binding tags.

also, the CommandArgument needs to be quoted:

CommandArgument='<%#Eval("PerformanceMeasureID") %>'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM