【问题标题】:An unhandled exception was generated during the execution of the current web request当前 Web 请求的执行过程中产生了一个未处理的异常
【发布时间】:2013-11-19 22:11:18
【问题描述】:

下面是我的代码

IMG http://imageshack.us/a/img812/7017/98qq.jpg

当我点击页面中的提交按钮时,我必须获取下拉列表值并将其发送到另一个页面。

我已关注 link!为此

当我尝试运行我的代码时出现错误

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

堆栈跟踪:

IMG http://imageshack.us/a/img534/9554/opdu.jpg

谁能告诉我是什么错误

【问题讨论】:

  • 请同时发布堆栈跟踪
  • "使用下面的异常堆栈跟踪。"
  • @NicholasV。是的,但是,堆栈跟踪在哪里?
  • 我已经编辑了我的帖子,请查看堆栈跟踪。

标签: c# asp.net


【解决方案1】:

就我而言,我创建了一个新项目,当我第一次运行它时,它给了我以下错误:

在执行过程中产生了一个未处理的异常 当前的网络请求。有关原产地和位置的信息 可以使用下面的异常堆栈跟踪来识别异常。

所以我的解决方案是转到 Visual Studio 中的 Package Manager Console 并运行:Update-Package

问题解决了!!

【讨论】:

    【解决方案2】:

    您的模板上有多个带有 runat="server" 的表单标签,很可能您的母版页中有一个,在您的 aspx 页面上删除一个,如果母版页文件中已经有表单,则不需要围绕着您的内容占位符。

    尝试删除该标签:

    <form id="formID" runat="server">
    

    当然还有结束标签:

    </form>
    

    【讨论】:

    • 我的母版页中已经有一个表单标签。我需要在我的 CityProfilepage.aspx 中有另一个表格吗?
    • 不,如果母版页中已经定义了一个,则不需要,甚至不能再拥有另一个(因为您仍然会遇到该错误)
    【解决方案3】:

    据我了解,您的网页中有不止一个表单标签会导致问题。确保每个页面只有一个服务器端表单标签。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-04-25
      • 1970-01-01
      • 2014-04-21
      • 2020-06-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-17
      相关资源
      最近更新 更多