【问题标题】:first chance exception system.web.httpexception file does not exist第一次机会异常 system.web.httpexception 文件不存在
【发布时间】:2013-09-09 16:09:54
【问题描述】:

我是 Web 编程新手,所以一开始我在记事本中制作了一份 html 简历,现在我尝试使用 Visual Studio 2010 并将该 html 页面(简历)嵌入其中。当我执行网站时 一些目录列表是在 chrome 中打开的,当我检查调试输出后出现异常时

 A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll

在那之后我做了两个改变 1-我选择了一个起始页 2-检查了

       CLR exceptions > System.web > System.Web.HttpException exception

从 Debug->Exceptions 抛出

在那之后,我得到了与未处理异常相同的错误,有两个选项继续或中断和附加信息:文件不存在

这些是我的html标签

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
    <!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 runat="server">
    <title>Official CV</title>
    <script type="text/javascript">
    function displayDate() {
    document.getElementById("demo").innerHTML = Date();
    }
   </script>
   </head>
   <body>
   <p id="demo">This is paragraph.</p>
   <button type="button" onclick="displayDate()"> Display Date</button>
   <table>
   <tr>
   <td>
   <h1>Abbas</h1>
   <address> House no 659, Street no 62, G-11/2, I </address>
   00923215250936
   </br>
   <h4>

   </br>
  <a id="#tips" href="http://abbasnaqvi512.tumblr.com/"> Go to my site </a>
  </h4>
 </td>
 <td>
 <img src="C:\Users\Abbas\Documents\My Web Sites\WebSite1\abbasShah.jpg"  width="104" height="142" alt="Abbas " > 
 </td>
 </tr>
 </table>
 <a id="Top"></a>
 <a href="#Bottom">Bottom</a>

<hr/>

<table border="1">
<caption>Education</caption>
<tr style="background-color:yellow">
<th>Degree Name</th><th>School</th><th>City</th>
</tr>
<tr>
<td> BS </td> <td> N</td><td>I</td>
</tr>
<tr>
<td>F</td> <td> P</td> <td>S</td>
</tr>
<tr>
<td>M</td><td>C</td><td>S</td>
</tr>
</table>

<a id="Bottom"></a>
<a href="#Top">Top</a>

</body>
</html>

我没有在 .cs 文件中写任何东西 我无法理解我搜索的大部分内容。请帮助我了解我的问题并解决它。

【问题讨论】:

  • WebForm1.aspx.cs 存在吗?如果没有服务器端控件,为什么还要使用 ASP.NET?
  • @DStanley 我将 WebForm1.aspx 添加为一个项目,因此它存在并且前四行与已经编写的相同

标签: c# html asp.net visual-studio-2010 exception


【解决方案1】:

由于您没有代码隐藏文件,只需从您的 Page 指令中取出 CodeBehind 和其他服务器端属性:

<%@ Page Language="C#"%>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-22
    • 1970-01-01
    • 2013-08-10
    • 2014-06-27
    • 1970-01-01
    • 2013-03-14
    相关资源
    最近更新 更多