0

I am building an asp.net app and I keep getting this error while trying to transfer pages:

Error executing child request for Edit_PropertyData.aspx

I have no clue what's causing it or how to fix it, any help would be greatly appreciated!

Here is the Page_Load event of 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
MatthewMartin
  • 32,326
  • 33
  • 105
  • 164
bbesase
  • 791
  • 4
  • 18
  • 31

2 Answers2

2

Server.Transfer doesn't allow you to do a lot of things. You're probably trying to use it to pass query string parameters or some such. But you don't need that - the URL doesn't change in the target of the transfer, so you've still got the original query string. This can be both a good and a bad thing, depending on how you use it :)

You probably want to use a different transfer method instead - if you're inside a HttpModule, have a look at HttpContext.Current.RewritePath.

Luaan
  • 62,244
  • 7
  • 97
  • 116
  • I tried the `HttpContext.Current.RewritePath` and another error came up. I'm just trying to make it so when the user clicks a button a different web page comes up – bbesase Apr 11 '14 at 12:59
  • @bbesase That's what `Response.Redirect` is for :) Or if you need the action to go to a different page, use `PostBackUrl` or change the form action. – Luaan Apr 11 '14 at 13:01
0

What have you tried so far? A quick search gives a number of similar error messages with proposed and accepted solutions.

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

You don't mention what you're transferring from, but I suspect Response.Redirect or HttpContext.Current.RewritePath will be a better alternative for you.

Community
  • 1
  • 1
InbetweenWeekends
  • 1,405
  • 3
  • 23
  • 28