如何修复执行子请求时出错?

时间:2014-04-11 12:41:13

标签: asp.net vb.net

我正在构建一个asp.net应用程序,并且在尝试传输页面时我一直收到此错误:

  

执行Edit_PropertyData.aspx的子请求时出错

我不知道是什么导致它或如何解决它,任何帮助将不胜感激!

以下是Page_Load

Edit_PropertyData.aspx事件
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    cmdChangeMaterial.Attributes.Add("onclick", "CheckSaveStatus();")
    cmdEditMaterial.Attributes.Add("onclick", "CheckSaveStatus();")

    If Session("Mode") Is "Edit" Then
        cmdEditMaterial.Enabled = True
        cmdSaveData.Enabled = True
    Else
        cmdEditMaterial.Enabled = False
        cmdSaveData.Enabled = False
    End If

    pnlMain.Visible = True
    pnlMain.Height = Unit.Pixel(650)

End Sub

2 个答案:

答案 0 :(得分:1)

Server.Transfer不允许你做很多事情。您可能正在尝试使用它来传递查询字符串参数或其他类似参数。但是你不需要 - 传输目标中的URL不会改变,所以你仍然得到了原始的查询字符串。这可能既好又坏,取决于你如何使用它:)

您可能希望使用其他转移方法 - 如果您在HttpModule内,请查看HttpContext.Current.RewritePath

答案 1 :(得分:0)

到目前为止你尝试了什么?快速搜索会针对建议和接受的解决方案提供许多类似的错误消息。

Server.Transfer throws Error executing child request. How to resolve?

http://forums.asp.net/t/1489436.aspx?Server+Transfer+Error+executing+child+request

http://support.microsoft.com/kb/320439

您没有提及您转移的内容,但我怀疑Response.RedirectHttpContext.Current.RewritePath将是您的更好选择。