当前位置:编程学习 > C#/ASP.NET >>

多功能在线考试系统改进版源码试卷评阅这个页面出的问题代码如下

这是提示: 


“/”应用程序中的服务器错误。 
-------------------------------------------------------------------------------- 

运行时错误 
说明: 服务器上出现应用程序错误。此应用程序的当前自定义错误设置禁止远程查看应用程序错误的详细信息(出于安全原因)。但可以通过在本地服务器计算机上运行的浏览器查看。 

详细信息: 若要使他人能够在远程计算机上查看此特定错误信息的详细信息,请在位于当前 Web 应用程序根目录下的“web.config”配置文件中创建一个 <customErrors> 标记。然后应将此 <customErrors> 标记的“mode”属性设置为“Off”。 


<!-- Web.Config 配置文件 --> 

<configuration> 
    <system.web> 
        <customErrors mode="Off"/> 
    </system.web> 
</configuration> 


注释: 通过修改应用程序的 <customErrors> 配置标记的“defaultRedirect”属性,使之指向自定义错误页的 URL,可以用自定义错误页替换所看到的当前错误页。 


<!-- Web.Config 配置文件 --> 

<configuration> 
    <system.web> 
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> 
    </system.web> 
</configuration> 



请看我的web.config文件: 

<?xml version="1.0"?> 
<!-- 
    注意: 除了手动编辑此文件以外,您还可以使用 
    Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的 
    “网站”->“Asp.Net 配置”选项。 
    设置和注释的完整列表在 
    machine.config.comments 中,该文件通常位于 
    \Windows\Microsoft.Net\Framework\v2.x\Config 中 
--> 
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> 
<appSettings> 
<add key="SocutDataLink" value="/data/wyx.mdb"/> 
<add key="FCKeditor:BasePath" value="~/fckeditor/"/> 
<add key="FCKeditor:UserFilesPath" value="/upfiles/"/> 
</appSettings> 
<connectionStrings/> 
<system.web> 
<!-- 
            设置 compilation debug="true" 将调试符号插入 
            已编译的页面中。但由于这会 
            影响性能,因此只在开发过程中将此值 
            设置为 true。 
        --> 
<compilation debug="false"> 
<assemblies> 
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> </assemblies> </compilation> 
<!-- 
            通过 <authentication> 节可以配置 ASP.NET 使用的 
            安全身份验证模式, 
            以标识传入的用户。 
        --> 
<authentication mode="Windows"/> 
<!-- 
            如果在执行请求的过程中出现未处理的错误, 
            则通过 <customErrors> 节可以配置相应的处理步骤。具体说来, 
            开发人员通过该节可以配置 
            要显示的 html 错误页 
            以代替错误堆栈跟踪。 

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> 
            <error statusCode="403" redirect="NoAccess.htm" /> 
            <error statusCode="404" redirect="FileNotFound.htm" /> 
        </customErrors> 
        --> 
</system.web> 
</configuration> 
------------------------------
修改为 <customErrors mode="off"/> 
还是显示同样的信息。真不知道怎么办好? 
这个程序是 《多功能在线考试系统改进版源码》
应该是试卷评阅这个页面出的问题代码如下:网上有人说是提示是红色那部分 
代码错误“要该那些字段啊!!怎么我运行“试卷评阅”的时候,运行不起了呀!它说“在选定的数据源上未找到名为“state”的字段或属性” 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserPaperList.aspx.cs" Inherits="Web_UserPaperList" %> 

<%@ Register Src="../Controls/lefttree.ascx" TagName="lefttree" TagPrefix="uc1" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" > 
<head id="Head1" runat="server"> 
    <title>成绩管理 </title>  
    <script src="../JS/Morning_JS.js" type="text/javascript"> </script> 
    <link href="../CSS/CSS.css" rel="stylesheet" type="text/css" />    
</head> 
<body style="margin: 0px" onload="showTime();"> 
  <form id="Form1" method="post" runat="server"> 
    <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%"> 
      
    <tr> 
      <td style="height:4px;" colspan="3"> 
            <img src="../Images/logo.jpg" style="border: 0px; left: 0px; position: relative; top: 0px;" title="" width ="100%"/> 
        </td> 
    </tr> 
        <tr style="background: url(../Images/lineS.jpg) repeat-x;"> 
            <td style="height:25;" colspan="3"> 
                   欢迎您: <asp:Label ID="labUser" runat="server" Text="Label" Width="70px"> </asp:Label>   
                                <script type="text/javascript">getDate(); </script> 

                <span id="ShowTime"> </span> </td>        
        </tr> 


          <tr> 
            <td  style="width: 130px" align="center" valign="top"> 
                <uc1:lefttree ID="Lefttree1" runat="server" /> 
          </td>          
              <td  style="width: 4px;  background: url(../Images/line.gif) repeat-y;"> 
            </td>  
            <td  valign="top" align="left"  width="960px"> 
          
                                      <h4>>>用户试卷评阅 </h4>  
                      <asp:GridView ID="GridView1" runat="server" AllowPaging="true" DataKeyNames ="UserID,PaperID" OnRowDataBound="GridView1_RowDataBound" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="8" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" Font-Size="13px" Width="100%" OnRowDeleting="GridView1_RowDeleting"> 
                    <Columns> 
                          <asp:BoundField DataField="UserID" HeaderText="UserID" ReadOnly="True"/> 
                            <asp:BoundField DataField="PaperID" Visible=False HeaderText="PaperID" ReadOnly="True"/> 
                            <asp:TemplateField HeaderText="用户姓名">                              
                                <ItemTemplate> 
                                    <asp:Label ID="Label2" runat="server"> <%# Eval("UserName") %> </asp:Label> 
                                </ItemTemplate> 
                                <HeaderStyle Wrap="False" /> 
                            </asp:TemplateField> 
                            <asp:TemplateField HeaderText="所在部门">                              
                                <ItemTemplate> 
                                    <asp:Label ID="Label3" runat="server"> <%# Eval("DepartmentName")%> </asp:Label> 
                                </ItemTemplate> 
                                <HeaderStyle Wrap="False" /> 
                            </asp:TemplateField> 
                            <asp:HyperLinkField DataNavigateUrlFields="UserID,PaperID" DataNavigateUrlFormatString="UserPaper.aspx?UserID={0}&PaperID={1}" DataTextField="PaperName" HeaderText="试卷(点击查看)" ItemStyle-Font-Bold="true"/>                      
                            <asp:TemplateField HeaderText="考试时间">                                
                                <ItemTemplate> 
                                    <asp:Label ID="Label5" runat="server"> <%# Eval("ExamTime") %> </asp:Label> 
                                </ItemTemplate> 
                                <HeaderStyle Wrap="False" /> 
                            </asp:TemplateField>    
                            <asp:BoundField HeaderText="是否评阅" DataField="state" /> 
                              <asp:CommandField ShowDeleteButton="True" HeaderText="删除" /> 
                    </Columns> 
                      <FooterStyle BackColor="White" ForeColor="#000066" /> 
            <RowStyle ForeColor="#000066" /> 
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" /> 
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /> 
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /> 
                </asp:GridView>                      
              <asp:Label ID="LabelPageInfo" runat="server"> </asp:Label> 
                <br /> 
            </td> 
        </tr> 
    
    </table>  
      </form>  
</body> 
</html> --------------------编程问答-------------------- 没有人知道是什么原因吗? --------------------编程问答--------------------
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,