【问题标题】:IIS duplicating responsesIIS 重复响应
【发布时间】:2014-08-13 08:17:14
【问题描述】:

我在我的服务器上使用 IIS 7。测试时(本地)。

看起来好像 IIS 发送一次请求但响应两次。

我知道这一点是因为 Fiddler 记录了 1 个请求,但在请求之后我可以注意到以下内容:

  1. 数据库上的任一插入命令都是重复的(2 个条目但单击了一次按钮)。

  2. 或错误消息重复。错误输出示例:

服务器拒绝了一个或多个收件人地址。服务器响应为:554 5.7.1 _EmailVariable_>: Relay access denied 服务器拒绝了一个或多个收件人地址。服务器响应为:554 5.7.1 _EmailVariable_>: Relay access denied

如何检查问题所在,以及如何解决。

我的vb代码的catch(尝试后)如下:

Catch Ex As Exception
    If Ex.Message.ToLower = "the server rejected one or more recipient addresses. the server response was: 554 5.7.1 <" + _EmailVariable_ + ">: relay access denied" Then
        Response.Write("In this error block!")
    Else
        Response.Write(ex.Message)
        'If Ex.Message.ToLower = "the transport lost its connection to the server." Then
        '    ClientScript.RegisterClientScriptBlock(Me.GetType(), "", "alert('PROBLEM: Please try again.')", True)
        'Else
        '    Response.Write(Ex.Message)
        'End If
    End If

    'ClientScript.RegisterClientScriptBlock(Me.GetType(), "", "alert('The following Error Occured. [" & Ex.Message.Replace(vbcrlf, "") & "]. If this is the first time you see this error please contact Clive or Jacques.')", True)
End Try

我只想说清楚,我理解接下来的错误,我的问题与错误无关。我想修复导致请求执行两次但只记录一个请求的 IIS 甚至 VB 插件。!

Here you can see my actual fiddler request

【问题讨论】:

    标签: asp.net vb.net iis


    【解决方案1】:

    我找到了解决办法。

    我处理请求的按钮没有 ID。

    因此,Visual Studio 自动添加了一个 onclick 事件,如果按钮有 Id,它通常不会这样做。

    所以非常简单,在我看来,当我单击按钮时,它会发送回发请求(按照 vb 的正常情况)并处理响应,当它准备好发送实际响应时,它会处理按钮的onclick 事件因此以重复响应结束。

    【讨论】:

      猜你喜欢
      • 2016-01-06
      • 1970-01-01
      • 2016-12-18
      • 2021-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多